Demo of live changes to a table (such as could be done via websockets)
Demo of live changes to a table (such as could be done via websockets)
I've put together a demonstration to show DataTables responding to 'external' requests to change the data.
It's available here as a jsfiddle
The requests aren't really external -- they're just generated randomly from within the javascript. But it shows (me) how DataTables could be made to respond to external input via websockets or similar mechanisms.
It creates a table, and then inserts, updates, and deletes rows. And there's colour and gratuitous animations and everything.
This is supposed to be a question, so: What do you think of it?
This question has an accepted answers - jump to answer
Answers
Looks really good! This is the whole point of DataTables having an API - you can use it for all sorts of situations such as this. For example, I've seen it used with web-socket updating for real-time financial record updating and it looks fantastic.
Thanks for sharing this with us.
Allan