grouping and updating data
grouping and updating data
I'm using grouping as shown in http://www.datatables.net/examples/advanced_init/row_grouping.html and including edit fields in other columns, with the idea that a user could update the group row and then the information will be populated (my own script) to the members (rows) belonging to that group.
It all works very nicely, but the problem is it doesn't update the actual data (for example, fnGetData returns null on the added row).
How do I modify the code to actually add the group row so that fnGetData or fnUpdateData would function properly?
"drawCallback": function ( settings ) {
var api = this.api();
var rows = api.rows( {page:'current'} ).nodes();
var last=null;
api.column(2, {page:'current'} ).data().each( function ( group, i ) {
if ( last !== group ) {
$(rows).eq( i ).before(
'<tr class="group"><td colspan="5">'+group+'</td></tr>'
);
last = group;
}
} );
An example would be nice. I tend to learn quicker visually. Thanks in advance