I have a simple HTML table which is bound using knockoutJS. However, I’ve added a custom binding which applies the jquery datatable plugin on the table.
When I click the headers, the table disappears. Any idea how I can get it working with knockoutJS?
Its actually unnecessary to use knockoutJs to carry out the binding of the dataTable. As knockoutJs already binds the HTML table to the model, just use the following:
The crucial part is to destroy the existing dataTable before the mapping, and re-create after mapping. I had to keep a reference to the initial dataTable for later destroying…