现在的问题是棘手的,所以我会发布的背景:
- 我有一个被通过AJAX加载页面上的片段。
- 该网页包含将要支持的,通过数据表与服务器端的处理填充的表。
- 每次我加载包含新表的片段,我告诉数据表从头启动表,使用
bDestroy : true
。
问题
即取数据作为JSON Ajax调用不断堆积起来,因为我通过AJAX加载新表。
题
如何保持从叠加起来,并减少他们一个一个这些电话? 谢谢。
码的样品(根据要求)
/* datatables initializer */
$("#table").dataTable({
bDestroy : true
, bServerSide : true
, sAjaxSource : "path/to/json.json"
, ...
});
/* script inside the AJAX loaded content. It outputs a <table>. */
$(function() {
$("body").trigger({ type : "tableready", options : { ... } });
});