row.child(format(row.data()) ).show(); - show() not working
row.child(format(row.data()) ).show(); - show() not working
row.child(format(row.data()) ).show(); - show() not working
$('#example tbody').on('click', 'td.details-control', function () {
var tr = $(this).closest('tr');
var row = table.row( tr );
if ( row.child.isShown() ) {
// This row is already open - close it
row.child.hide();
tr.removeClass('shown');
}
else {
// Open this row
row.child(format(row.data()) ).show();
tr.addClass('shown');
}
} );
Error
Property 'show' does not exist on type 'Api<any> | RowChildMethods<any>'.
Property 'show' does not exist on type 'Api<any>'
Don´t know more what to do, kindly give some feedback if you know why
Thanks
Edited by Colin - Syntax highlighting. Details on how to highlight code using markdown can be found in this guide.
Answers
It appears to be working as expected here. We're happy to take a look, but as per the forum rules, please link to a test case - a test case that replicates the issue will ensure you'll get a quick and accurate response. Information on how to create a test case (if you aren't able to link to the page you are working on) is available here.
Cheers,
Colin
Thanks for helping, but is it possible to push the format() function with another solution?
row.child( format(row.data()) ).show();
Thanks
Sample Capture
Not sure what you mean.
format()
is just a function. You can customize the function. Or you can name the function something else if you like. The function is used to format the HTML output.The code snippets look the same as the example Colin linked to. Do you have a
format()
function? Is the variabletable
assigned to the Datatable API?Can you post a test case showing the issue so we can help debug?
Kevin
Is i have a format function, the real problem is
row.child(format(row.data())).show();
This wont work, see imagerow.child.show()
This works but not passing the format functionOk I found a solution was removing
show()
I don't know if it is a but with Typescript 3.9