Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.
Sign upExpandable rows support #68
Comments
|
Using exclusively Angular, it might be possible. function format(d) {
...
}
$scope.$on('event:dataTableLoaded', function(event, loadedDT) {
var dt = loadedDT.dt;
$('#example tbody').on( 'click', 'tr td:first-child', function () {
var tr = $(this).closest('tr');
var row = dt.row( tr );
var idx = $.inArray( tr.attr('id'), detailRows );
if ( row.child.isShown() ) {
tr.removeClass( 'details' );
row.child.hide();
// Remove from the 'open' array
detailRows.splice( idx, 1 );
}
else {
tr.addClass( 'details' );
row.child( format( row.data() ) ).show();
// Add to the 'open' array
if ( idx === -1 ) {
detailRows.push( tr.attr('id') );
}
}
} );
// On each draw, loop over the `detailRows` array and show any child rows
dt.on( 'draw', function () {
$.each( detailRows, function ( i, id ) {
$('#'+id+' td:first-child').trigger( 'click' );
} );
} );
}); |
|
Thanks. |
|
Yes. With v0.1.0, you can get the DataTable object with jQuery: var dt = $('#' + loadedDT.id).DataTable(); |
|
Thanks for your inputs. |
|
I am unable to reproduce this |
|
Hi, is it possible to have the function "format" return an angular expression? I've been trying but it only treat it as a plain html, so I think there must be a way to tell angular to interpret or compile the result of "format" function in order to make it work.. any help? |
|
why is this issue closed? still an issue |
Is it possible to do expandable row using angular-datatable?
Ref: https://datatables.net/examples/server_side/row_details.html