我正在尝试设置一个自定义属性并能够稍后访问/编辑它。这甚至可能吗,我在旧版本中看到可以使用 fnSettings 但如何在 1.10.5 中使用它?
$('#table').DataTable({
customProp: 'Hello World'
});
然后单击按钮,我想我可以执行以下操作:
$('.test').on('click', function(e){
var table = $('#table').DataTable();
console.log(table.settings.oInit.customProp);
}
但是我得到: Uncaught TypeError: Cannot read property 'customProp' of undefined
有谁知道我该怎么做?