Variable number of columns in dataTables. Number of cols decided dynamically
Variable number of columns in dataTables. Number of cols decided dynamically
Hi Allan,
I have been trying to use dataTables on my page which has multiple tables each having different number of columns. The number of columns for each of the tab le is decided dynamically when the data from the server is being filled in the table.
I am using mason in which I iterate over the array containing data and fill the html table.
With same constructs if I use fixed number of columns then the dataTable works properly.
Can you suggest something to work around this? I am using dataTables 1.7.2.
Thanks
Pooja Gupta
I have been trying to use dataTables on my page which has multiple tables each having different number of columns. The number of columns for each of the tab le is decided dynamically when the data from the server is being filled in the table.
I am using mason in which I iterate over the array containing data and fill the html table.
With same constructs if I use fixed number of columns then the dataTable works properly.
Can you suggest something to work around this? I am using dataTables 1.7.2.
Thanks
Pooja Gupta
This discussion has been closed.
Replies
Is it possible to initialise each table on the webpage separately with datatables?
Regards
Pooja Gupta
Unfortunately I introduced a bug in 1.7.2 which is causing a few issues when initialising multiple tables in a single call with different column lengths. This has been fixed in the development version which can be downloaded from here: http://github.com/DataTables/DataTables/blob/master/media/js/jquery.dataTables.js . That will form part of the 1.7.3 release. Let me know if you have any problems with it.
Allan
1.7.3 is the dev version and I have to put my code in production.
What about 1.7.1, does it also have similar problems? In another thread you said that you introduced the bug by mistake in 1.7.2, so 1.7.1 should do well.
Thanks
Pooja Gupta
There are only two changes between 1.7.2 and the currently committed development version, the first to fix the problem you are seeing, and the second to fix an issue with TableTools 2 (as yet unreleased, so it's unlikely to effect anyone) when infinite scrolling and using server-side processing.
It might be worth looking over the 1.7.2 release notes ( http://datatables.net/download ) before rolling back to 1.7.1 to see if there is anything that might effect you (most of the fixes were edge cases though).
Regards,
Allan