how to use data-table in spa application

how to use data-table in spa application

farhadtablefarhadtable Posts: 47Questions: 27Answers: 1

i create spa application with combined Knockout + CrossroadsJS + RequireJS.

This question has accepted answers - jump to:

Answers

  • allanallan Posts: 63,368Questions: 1Answers: 10,449 Site admin
    Answer ✓

    There isn't a direct integration for DataTables with any of those libraries, but basically you would just initialise DataTables whenever you need it and use destroy() to clean up when removing the table.

    Allan

  • greg.blassgreg.blass Posts: 12Questions: 2Answers: 2
    Answer ✓

    Any way to clear out the array returned by $.fn.dataTable.tables() in addition to destroying it?

    I'm running into an issue where save state won't work because its adding +1 to the table name on page nav (DataTable_Table_0, DataTable_Table_1, etc).

  • allanallan Posts: 63,368Questions: 1Answers: 10,449 Site admin
    Answer ✓

    Assign your own id to the table. DataTables will always use a unique id for the table being created. It has an internal counter that is simply incremented every time a table without an id is created.

    Allan

This discussion has been closed.