$(document).ready(function() {
var oTable = $('#example').dataTable({
"aoColumns": [
{"mData": "name"}
]
});
// Sample model
var Person = function() {
this.name = null;
};
p = new Person();
// Add first row.
oTable.fnAddData(p);
// Try first update.
oTable.fnUpdate( {name: 'hardcoded'}, 0 ); // <--- Works
// Change the name property.
p.name = 'updated';
oTable.fnUpdate( p, 0 ); // <--- Doesn't work
} );
当我运行 oTable.fnUpdate( p, 0 ); 时,我无法让它工作 我正进入(状态
未捕获的类型错误:无法调用未定义的方法“fnSetData”
为什么?