简体   繁体   English

jQuery DataTable动态分页

[英]Jquery DataTable Dynamic Pagination

How can i configure Jquery DataTable to not load all content on first load 我如何配置Jquery DataTable在第一次加载时不加载所有内容

eg if i have 1000 records, DataTable will load all in first load this can be heavy though. 例如,如果我有1000条记录,则DataTable将在第一次加载时全部加载,但这可能很重。 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. 有用于分页的ServerSide配置,请让我知道,如果我的问题是重复的,那就喊出来。

Check here full jquery example jquery-datatable-ajax-tutorial-with-example 在这里查看完整的jquery示例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");
});

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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