在Jquery数据表1.10.10中延迟加载表行? [英] Lazy loading of table rows in Jquery datatables 1.10.10?
问题描述
我正在使用jquery数据表1.10.10.是否有任何选项可以延迟加载数据表中的行数据.例如,如果数据表包含50行记录,那么如果我将数据表滚动到末尾,它将请求另外50行数据并将其追加到已经存在的数据表中?
I am using jquery datatable 1.10.10. Is there any options for lazy loading of row data in datatable. For example , if the datatable contains 50 row of records, if I scroll the datatable till the end, it requests for another 50 rows of data and appends to already existing datatable ?
推荐答案
可以使用 Scroller 扩展和服务器端处理,请参见滚动器-服务器端处理示例.
Lazy loading can be achieved with Scroller extension and server-side processing, see Scroller - Server-side processing example.
例如:
$(document).ready(function() {
$('#example').DataTable( {
serverSide: true,
ordering: false,
searching: false,
ajax: '/path/to/script',
scrollY: 200,
scroller: {
loadingIndicator: true
}
} );
} );
或者,我开发了 PageLoadMore 插件,该插件可以替换默认的分页控件使用加载更多"按钮.参见此答案或,以获取更多示例和详细信息.
Alternatively I have developed PageLoadMore plug-in that allows to replace default pagination control with "Load more" button. See this answer or jQuery DataTables: "Load more" button article for more examples and details.
这篇关于在Jquery数据表1.10.10中延迟加载表行?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!