Search code examples
jquerydatatables

JQuery Datatables. How can I change the current page programmatically?


I have pagination on my table. I want go back back to the first page whenever a function is called. How can I do that?


Solution

  • from the docs: http://datatables.net/ref#fnPageChange

    $(document).ready(function() {
      var oTable = $('#example').dataTable();
      oTable.fnPageChange( 'first' );
    } );