FixedColumns
FixedColumns
Hi there.
My first post, so please be gentle with me if I don't submit enough information. I was wondering if anyone has come across a problem where they are using jQuery UI Tabs, dataTables and FixedColumns plugin.
I have four tabs, three of which contain a dataTable, each dataTable also has the plugin FixedColumns attached such that a shallow but wide table can be scrolled with the leftmost column fixed in place. The dataTables are loaded via an Ajax call, which all works great until I initiate the FixedColumns option. When I press the submit button, the left most column header disappears, and the right most column of data also vanishes! Repeatedly pressing the submit button will eventually render a single column containing the last column header and the first data column.
I've tried recreating the datatables by using the fnDestroy function as well as the jQuery remove but neither alter the above problem.
Any ideas?
My first post, so please be gentle with me if I don't submit enough information. I was wondering if anyone has come across a problem where they are using jQuery UI Tabs, dataTables and FixedColumns plugin.
I have four tabs, three of which contain a dataTable, each dataTable also has the plugin FixedColumns attached such that a shallow but wide table can be scrolled with the leftmost column fixed in place. The dataTables are loaded via an Ajax call, which all works great until I initiate the FixedColumns option. When I press the submit button, the left most column header disappears, and the right most column of data also vanishes! Repeatedly pressing the submit button will eventually render a single column containing the last column header and the first data column.
I've tried recreating the datatables by using the fnDestroy function as well as the jQuery remove but neither alter the above problem.
Any ideas?
This discussion has been closed.
Replies
> When I press the submit button
What submit button? :-). What is it that you are trying to do? So you press the button and the form submits? Or are you doing it by Ajax? Can you link us to your page please?
Allan
The idea behind this is that the original page has more form elements which dependent upon contents retrieve information via Ajax and populates a JS array which is used for my data table. Now these form elements can be amended and the search button pressed again, which should populate the form with new data. I cannot use the bRetrieve since I'm after new data, thus use the bDestroy method.
As you can see, with subsequent presses of the button, the heading loses the left hand most heading, and the right hand most data column disappears. This continues until the only thing that is left is the fixed column. Now if you increase the number of fixed columns to say 2, with each click of the search button, 2 columns now disappear.
Any help you can offer me, or any explanation of why this is happening, I would appreciate a lot.
With new columns, or just new data. If just new data then use fnClearTable and fnAddData - it will be much faster. However, if you are changing the columns or the table configuration, then yes, you'll need to destroy the table. (edit - looks like it is a complete refresh of the whole table - sorry - leaving for reference though :-) ).
> As you can see, with subsequent presses of the button [...]
If you disable FixedColumns does it work as you would expect? FixedColumns doesn't actually have a hook for the DataTables destroy event at the moment which is going to be badly messing up the DOM on each destroy event. I need to add that particular feature to FixedColumns - added to the to-do list :-)
Allan
If I do nuke the table and don't have the fixed columns set, then it all works as I would expect.
Cheers
Allan