sara
sara

Reputation: 21

How to jump into specific page in datatables

An input box to enter a specific page number. On keyup, the datatable has to be on the typed page number with corresponding data

Tried page() api

var table = $('#dataList').DataTable({});
table.page(2).draw( 'page' );

But not working. is there any solution to do the same.

Upvotes: 2

Views: 4999

Answers (1)

Rizwan Saleem
Rizwan Saleem

Reputation: 146

You can try this

$(document).ready( function () {
  var table = $('#example').DataTable();
   var pageNo =6
   table.page(pageNo-1).draw('page');
} );

its working for me check this demo

Upvotes: 2

Related Questions