简体   繁体   中英

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.

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM