row remove and toData
row remove and toData
opto
Posts: 5Questions: 2Answers: 0
my data comes from an array.
I remove rows, they disappear from the table, but they stay in table.toData().
What am I doing wrong?
All by adding a button in each row and on click:
$this = $(this);
var dtRow = $this.parents('tr');
var table1 = $('#example1').DataTable();
table1.row(dtRow[0].rowIndex-1).remove().draw( false );
any help is appreciated,
Klaus
This discussion has been closed.
Answers
What is
toData()
? As far as I know this is not a Datatables method or API.Please post a line to your page or a test case showing the issue so we can help debug.
https://datatables.net/manual/tech-notes/10#How-to-provide-a-test-case
Kevin
I am sorry, this is what I meant: table.data().toArray();
the array is not identical to the table that is visible. Thus, I was wondering what remove does: actually remove the nodes, or just make them invisible?
see https://datatables.net/reference/api/toArray()
Hi @opto ,
The docs for
row().remove()
state the followingI've put together an example for you to show this working. Could you modify this to show your issue?
Thanks,
Sandy