checkbox is unchecked to delete that row
checkbox is unchecked to delete that row
cheikhsadbouh
Posts: 1Questions: 1Answers: 0
i want when checkbox is unchecked to delete that row it's work fine , but i got some error
this is my code :
saleTB.rows().every(function (rowIdx, tableLoop, rowLoop) {
var data = this.data();
if(data != '') {
if (data[0] == tb[0]) {
console.log(' row data :' + data + " row index : " + rowIdx);
console.log(' col[0] :' + data[0]);
saleTB.row(rowIdx)
.remove()
.draw();
console.log(' removed row data :' + data);
console.log(' removed row idex :' + rowIdx);
} else {
// i=1;
}
}
// ... do something with data(), or this.node(), etc
});
error :
Uncaught TypeError: Cannot read property '0' of undefined
This question has an accepted answers - jump to answer
This discussion has been closed.
Answers
Without seeing the code in action this is just a guess:
I'm guessing the problem is with
tb[0]
. Where is it defined?Kevin