2015-05-09 55 views
0

如何配置Jquery的数据表不加载的所有内容第一次加载jQuery的数据表动态分页

e.g如果我有记录,数据表将加载所有在第一次加载这可能是沉重的,但。点击分页部分时如何加载每个内容?像This

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

没有为喜爱分页请让我知道,如果我的问题是重复的,就骂了服务器端的配置。

+0

http://mobisoftinfotech.com/resources/blog/web-programming/jquery -datatable-ajax-tutorial-with-example-project/ –

回答

0

入住这里全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 '); 
});