简体   繁体   中英

Jquery DataTable Dynamic Pagination

How can i configure Jquery DataTable to not load all content on first load

eg if i have 1000 records, DataTable will load all in first load this can be heavy though. how about loading each content when click on pagination part? Like This

$(document).ready( function () {
  $('#example').dataTable( {
    "bServerSide": true,
    "sAjaxSource": "xhr.php"
  } );
} );

There is ServerSide configuration for alike pagination please let me know, if my question is duplicate just shout out.

Check here full jquery example jquery-datatable-ajax-tutorial-with-example

var studentTable;

jQuery(document).ready(function() {

studentTable = jQuery("#studentListTable").dataTable({
"bJQueryUI" : true,
"sPaginationType" : "full_numbers",
"bRetrieve" : true,
"bFilter" : true,
"iDisplayLength": 10,
"bProcessing" : true,
"bServerSide" : false,
"aoColumns" : [ { "bSearchable" : false,"bVisible" : false,
"asSorting" : [ "asc" ] },
{"sWidth" : "20%","bSortable" : true },
{"sWidth" : "20%","bSortable" : true },
{"sWidth" : "20%","bSortable" : true },
{"sWidth" : "20%","bSortable" : true },
{"sWidth" : "20%","bSortable" : true }
]
});

jQuery(".ui-corner-br").addClass("ui-widget-header_custom");
});

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