understanding examples - table updates and side-effects

understanding examples - table updates and side-effects

northnorth Posts: 2Questions: 1Answers: 0

Greetings. I'm impressed with datatables, so I started experimenting with the examples. I wrotefunctions to insert rows programmatically, for example in scroll_y.html Seems OK, but I noticed the caption stating the number of rows and pages ("Showing N of N entries") doesn't update automatically. Worse, I don't understand why a table resets to the hardwired data when sorted. I assume the action takes place in dataTables.jqueryui.js below "// Attach a sort listener to update on sort" but don't see what code would edit the table contents in that way. Is this expected?

Answers

  • northnorth Posts: 2Questions: 1Answers: 0

    OK, I'm bogus, datatables provides and entire API for table operations that needs to be explicitly invoked - table operations are not performed through side effects to HTML table DOM manipulation of course.

    Someone could have pointed this out, though!

  • allanallan Posts: 62,990Questions: 1Answers: 10,367 Site admin

    Hi,

    Just saw your message just now. Yes, you need to use the API to manipulate the table - the FAQs note this.

    I'm going to look into the DOM mutation API soon and see what would be involved with getting that up and running with DataTables which would be good fun!

    Allan

This discussion has been closed.