Can't Change header dynamically
Can't Change header dynamically
habibillah
Posts: 4Questions: 0Answers: 0
I want to make a function on my own javascript file that will make data table both header and data can be changed dynamically as supplied on function parameters. However, jQuery DataTable seem catch header definition that cause datatable run fail.
I have made sample on JSFiddle at http://jsfiddle.net/a896Y/
can anyone help me to fix this problem?
I have made sample on JSFiddle at http://jsfiddle.net/a896Y/
can anyone help me to fix this problem?
This discussion has been closed.
Replies
Here sample update http://jsfiddle.net/a896Y/1/
If you want to remove one of the columns you need to use fnDestroy and then a bit of jQuery / DOM manipulation to actually modify the thead.
Allan
It is not just to remove a column, but reinitialize columns and data. I have tried to use fnDestroy but same problem occur. see at http://jsfiddle.net/a896Y/4/ and http://jsfiddle.net/a896Y/3/
[code]
HTML
-----
Javascript
-----
var oTable = $('#datatable-sample').html('').children('table').dataTable({
...
});
[/code]
Look at http://jsfiddle.net/a896Y/2/