【发布时间】:2015-05-16 11:48:50
【问题描述】:
我正在尝试设置自定义属性,以便稍后访问/编辑它。这甚至可能吗,我在旧版本中看到可以使用 fnSettings 但我如何在 1.10.5 中使用它?
$('#table').DataTable({
customProp: 'Hello World'
});
然后单击按钮,我想我可以执行以下操作:
$('.test').on('click', function(e){
var table = $('#table').DataTable();
console.log(table.settings.oInit.customProp);
}
但是我得到:未捕获的类型错误:无法读取未定义的属性“customProp”
有人知道我该怎么做吗?
【问题讨论】:
标签: jquery jquery-datatables datatables-1.10