rows().invalidate() fail on table initialized from DOM
rows().invalidate() fail on table initialized from DOM
nlips
Posts: 3Questions: 0Answers: 0
Test case here:
https://jsfiddle.net/nlips/rm4jm53a/
This discussion has been closed.
Replies
Hi,
This has already been fixed in the nightly version and will be included in the 1.10.9 release.
Allan
Hi,
Looks like there's still a problem with rows().invalidate(), even with the nightly build. Anyway, I can't understand why this test case doesn't work:
https://jsfiddle.net/g3dok19h/1/
In it, you'll see that:
What am I missing?
Thanks,
Patrick
The issue is that $.merge is adding the two names "Fred" and "Fiona" as new elements in the array. DataTables doesn't track the original array, just the objects in it.
If you were to change the data in those objects then it works as expected.
Allan
Thanks Allan, you're the best.
I needed to change all objects in the array, I ended up using:
table.rows().remove().rows.add(data).draw();