There isn't a built in method of doing that, but there are two ways of doing it off the top of my head:
1. Make one of the tables a "master" and have a draw callback function on it (fnDrawCallback), which will change the pagination of the slave table to match whatever the paging of the master is.
2. You could use the API method fnPageChange to build your own paging controls and control both tables from that.
Looks good to me - nice one! Thanks for sharing your solution with us.
The only thing I would say is that at the moment both pagination and length changing are enabled then the slave table will be drawn twice. You might want to combine the if statements for that case.
You might need to add a condition for the case when _iDisplayLength === -1 (i.e. display all) and set _iDisplayStart = 0 and _iDisplayEnd to the number of records: fnRecordsDisplay()
Replies
1. Make one of the tables a "master" and have a draw callback function on it (fnDrawCallback), which will change the pagination of the slave table to match whatever the paging of the master is.
2. You could use the API method fnPageChange to build your own paging controls and control both tables from that.
Allan
[code]
"fnDrawCallback": function( oSettings ) {
if(oSettings.oFeatures.bPaginate) {
tblASettings._iDisplayStart = oSettings._iDisplayStart;
tblASettings._iDisplayEnd = oSettings._iDisplayEnd;
tblATable.fnDraw( false );
}
if(oSettings.oFeatures.bLengthChange) {
tblASettings._iDisplayLength = oSettings._iDisplayLength;
tblASettings._iDisplayStart = oSettings._iDisplayStart;
tblASettings._iDisplayEnd = oSettings._iDisplayEnd;
tblATable.fnDraw( false );
}
},
[/code]
Seems to work fine. Is this how you would do it?
The only thing I would say is that at the moment both pagination and length changing are enabled then the slave table will be drawn twice. You might want to combine the if statements for that case.
Allan
I did notice an error when I changed the length menu to All. It erased the table and pagination but didn't throw any errors.
Do you have any thoughts as to what's going on?
Jamil
Allan