从此页面:
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/