RowGroup with Expand Collapse
RowGroup with Expand Collapse
ArchanaD
Posts: 2Questions: 1Answers: 0
Hi,
I am using Data Table for displaying data. I have requirement of grouping data. This I can achieve with the help of RowGroup plugin.
My problem is; I want to use it further to display only grouped rows as summary & on clicking of it it should display detailed row information.
My Question is how to get Rows.data() for group of rows?
I am using below function on click of
$('#example tbody').on( 'click', 'tr td.details-control', 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') );
}
}
} );
Thanking you in anticipation
This discussion has been closed.
Answers
This pull request recently added that very feature. It is in the nightly version. I haven't yet played around wtih it myself, but that should do what you are looking for.
Allan
Thanks Allan. When it will be get merged in released version? Any timeline?
When its ready I'm afraid. No specific schedule for it yet.
Allan