jquery - 我不明白 bRetrieve (jquery DataTable) 的描述

标签 jquery datatables

从此页面:

http://datatables.net/new/1.7

Retrieving with an initialisation object - $(...).dataTable({"bRetrieve":true, ...}); - It is not possible to alter the table parameters after initialisation like this, but it is useful to be able to just use a single call to $().dataTable(). Setting bRetrieve to true, tells DataTables that you acknowledge this.

我认为下面这行是我不明白的:

but it is useful to be able to just use a single call to $().dataTable(). Setting bRetrieve to true, tells DataTables that you acknowledge this.

相关的是bDestroy:

Reinitialising the table - $(...).dataTable({"bDestroy":true, ...}); - Actually, it is possible to reinitialise the table, but its fairly brutal. This will destroy the old table and then initialise a new one.

有人可以解释一下它们是如何相互作用的吗?我觉得在阅读此描述之前我应该​​理解一些假设,但显然我不这样做。

最佳答案

正如数据表网站中提到的:http://www.datatables.net/ref

“bRetrieve”属性用于确认您理解的数据表,对于特定表,如果数据表实例已经创建,而不是创建新对象,数据表插件将返回现有对象。

编辑:

这同样适用于“bDestroy”属性。它告诉数据表,该表也可以被销毁。如果您将此属性设置为 false (这表明您不想销毁此表),那么在对数据表对象调用 fnDestroy() 函数后,将会弹出一个警告,提示表不能被摧毁。

关于jquery - 我不明白 bRetrieve (jquery DataTable) 的描述,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14385584/

相关文章:

Jquery:使整个 block 可点击,同时保留在新选项卡/窗口中打开的能力

javascript - 通过jquery创建模态窗口

javascript - jquery .click 看不到 .append() 代码

javascript - 使用Json数据源实现数据表中的复选框选择

javascript - 如何使用 jQuery DataTables 呈现单选按钮组

jquery - 如何使用jquery从checkboxlist控件中获取复选框的选定索引?

javascript - Bootstrap 开关不适用于动态创建的复选框输入

php - 渲染通过ajax获取的数据表列

javascript - 如何从自定义按钮调用数据表 csv 按钮

javascript - 我的编辑按钮在下一页不起作用(仅在第一页起作用)