admin管理员组文章数量:1024905
How can i configure Jquery DataTable to not load all content on first load
e.g 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.
How can i configure Jquery DataTable to not load all content on first load
e.g 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.
Share Improve this question asked May 9, 2015 at 5:11 Talha HabibTalha Habib 431 gold badge1 silver badge8 bronze badges 1- mobisoftinfotech./resources/blog/web-programming/… – Mujammil H Kazi Commented Jan 25, 2016 at 8:45
2 Answers
Reset to default 2Use the "deferLoading" attribute:
https://datatables/examples/server_side/defer_loading.html
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");
});
How can i configure Jquery DataTable to not load all content on first load
e.g 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.
How can i configure Jquery DataTable to not load all content on first load
e.g 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.
Share Improve this question asked May 9, 2015 at 5:11 Talha HabibTalha Habib 431 gold badge1 silver badge8 bronze badges 1- mobisoftinfotech./resources/blog/web-programming/… – Mujammil H Kazi Commented Jan 25, 2016 at 8:45
2 Answers
Reset to default 2Use the "deferLoading" attribute:
https://datatables/examples/server_side/defer_loading.html
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");
});
本文标签: javascriptJquery DataTable Dynamic PaginationStack Overflow
版权声明:本文标题:javascript - Jquery DataTable Dynamic Pagination - Stack Overflow 内容由热心网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://it.en369.cn/questions/1745496166a2153177.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论