$(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)时,我无法使其工作;我正在
未捕获的TypeError:无法调用未定义的方法'fnSetData'
为什么?
答案 0 :(得分:3)