Changing number of columns in a DataTable

Changing number of columns in a DataTable

jthallileyjthalliley Posts: 4Questions: 0Answers: 0
edited June 2012 in General
Perhaps I'm misusing DataTables, but here's what I'm trying to accomplish and what's not working:

I'm generating HTML for the rows in a table via ICanHaz.js. I then apply DataTables features to that table. All is well. Later, the user makes a selection that causes me to re-generate the HTML for the rows in the table, and this time the number of columns changes. So I re-invoke .dataTable and all is well. But only well in Chrome and Safari, but not in IE.

I've set bDestroy to true so that DataTables' attributes are removed from the table before I re-invoke .dataTable on the table. I've adjusted aoColumns to deal with the new number of columns, add new headers, etc.

Like I've said, all is well in Chrome and Safari, but in IE, the underlying jQuery is throwing an exception, so it never returns from the re-invocation of .dataTable.

Does this make sense? More info needed? Any ideas as to the proper way to deal with a table that changes shape (number of columns)?

Thanks,
Tom

Replies

  • jthallileyjthalliley Posts: 4Questions: 0Answers: 0
    Are there a list of conditions that cause the .dataTables call to fail? For example, if the number of header columns does not match the number of tbody columns, the call will fail.

    The exceptions I'm getting relate to aoData and asSorting, neither of which I'm using.
  • jthallileyjthalliley Posts: 4Questions: 0Answers: 0
    No ideas regarding failing .dataTable calls?
  • jthallileyjthalliley Posts: 4Questions: 0Answers: 0
    Note, this is not an IE only issue; the call fails to return in Chrome and Safari as well.
This discussion has been closed.