我正在尝试在数据表中添加新行,并通过使用 API .any() 检查行中是否已经存在 id,如果存在,我不会向我的数据表中添加新行,这是结果形式我来自数据库的请求见http://pastie.org/10196001,但我在检查时遇到了麻烦。
socket.on('displayupdate',function(data){
var dataarray = JSON.parse(data);
dataarray.forEach(function(d){
if ( table.row.DT_RowId(d.DT_RowId).any() ) { // TypeError: table.row.DT_RowId is not a function
console.log('already exist cannot be added');
}else{
table.row.add(d).draw();
}
});
});
先感谢您。