Changing number of columns in a DataTable
Changing number of columns in a DataTable
jthalliley
Posts: 4Questions: 0Answers: 0
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
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
This discussion has been closed.
Replies
The exceptions I'm getting relate to aoData and asSorting, neither of which I'm using.