Page Numbering
Page Numbering
mediatomcat
Posts: 7Questions: 2Answers: 0
Hi,
I am leaving a table to another page and then returning and would like to know what parameter I can set to set the correct page number. I am able to show the right data, by using the iStart and iLength parameters, but even though the data is page 2 data, then buttons at the bottom still say page 1.
Any ideas?
This discussion has been closed.
Answers
It sounds like what you want may be http://datatables.net/reference/api/page() .
I tried this, but it hangs the page on Processing:
"fnPreDrawCallback": function( oSettings ) {
var table = $('#datatable_tabletools').DataTable();
table.page( 'next' ).draw( false );
}
We talked about this by e-mail a bit, but for anyone else reading, the
stateSave
feature will handle paging. Enable state saving and then when you come back to the page the state (sorting, paging and filtering) will be restored.Allan
Thanks Allen. Good quick feedback.
The way to set the page if you are not using stateSave:
oT.fnPageChange( 1 ); // 1 being page 2
Yes, the method you are using will still work, but I guess the question is, how to you know what page to jump to? If you always want to jump to page 2, then your call above should work okay.
Allan
I am using a session to pass the value:
oT.fnPageChange( <?php echo ($_SESSION['pageNumber']; ?> );