CSS is lost after destroy and dynamic columns question
CSS is lost after destroy and dynamic columns question
Datatables is awesome. thanks for great tool.
Question
1.
the tables loads up fine on document .ready but when i destroy and recreate it again the css inside table is lost. the column width is reverse back to minimum and the row height is greater than normal. i try to save the settings and assigned back when it gets create again. no success so far. what am i doing wrong? I do have bDestroy when i recreate the table again.
2.
I am little confuse regarding how datatable works. Can I build the html table in jquery and apply datatables or does the html exist in the original markup when the page first load? I am trying to create a table that have different number of column based on what table a user selects.
Can i generate the table markup on client side only and have it work with datatables?
Thanks in advance
Question
1.
the tables loads up fine on document .ready but when i destroy and recreate it again the css inside table is lost. the column width is reverse back to minimum and the row height is greater than normal. i try to save the settings and assigned back when it gets create again. no success so far. what am i doing wrong? I do have bDestroy when i recreate the table again.
2.
I am little confuse regarding how datatable works. Can I build the html table in jquery and apply datatables or does the html exist in the original markup when the page first load? I am trying to create a table that have different number of column based on what table a user selects.
Can i generate the table markup on client side only and have it work with datatables?
Thanks in advance
This discussion has been closed.
Replies
Same problem with me. The css is not applied, only the one from jquery.datatable.css.
Moreover, i apply a plugin on the datatable table. It works for the first one, not when I recreate them. Like there is already another one...
Do you succes to find a solution ? thanks
Bastien
1. Can you link to your example please? The destroy isn't perfect, but DataTables itself shouldn't be setting row heights - unless you are using a plug-in?
2. You can do it either way :-)
@bastien: Please also link to your example page so I can see what is happening. Do you have a 'title' attribute for your style tags - that can lead to only one stylesheet being applied.
Allan
I solve my problem and I described the solution here : http://www.datatables.net/forums/discussion/9516/destroy-the-datatable-in-order-to-recreate-tabs-use#Item_4
Thanks
Bastien