oTable.row().remove() remove the rows but when add new records it also append old reocords too
oTable.row().remove() remove the rows but when add new records it also append old reocords too
Hi, I am using ajax hit to add rows to datatable using oTable.row().add([]); and removing the rows which are grouped using delete button the grouped row. When i click on grouped row it removes all the rows of that group. But when i again add same records or new records it add delete records too.
I have to append multiple records on button click so, bDestroy:"true" and oTable.clear() doesn't help me even oTable.clear() all the table. I don't want this because I only want to remove the one group and rows under that group.
Answers
Can you link to a test page showing the issue please. I don't see any reason why
row.add()
would remove rows - it should do the exact opposite...Allan
yes i know row.remove() remove the rows. and I also typed row.add() adding..
I have no link because i am getting data from server side so can't create a link, but here my code...
To Add rows to table
To remove rows under a group and clicked group row code
Scanning the code, it looks like it should work. I would need to be able to debug it at runtime to be able to offer any help.
One thing - you don't call
draw()
after the remove, which you should.Allan
I tried this also, But in that case it first remove the rows and again add to the table. I test it by debug the code.
It only remove the Grouped row only where i put the delete button. Rest of the rows under that group automatically added again.
Hey Allan,
Please help me I have tried all the ways but didn't get any solution.
Hey done i used .empty() instead of .remove() and its works like charm....:)