column auto resizing after table update
column auto resizing after table update
ConorHiggins
Posts: 9Questions: 0Answers: 0
Hi all,
I've been trying something for the last day or so and have hit a brick wall each time. I have a basic work around for it at the moment but I don't want to be using workarounds really :)
I have a table called monTable which is a global variable. This table has its content loaded and reloaded every 20 seconds using JSON. This works really well, and I have also been able to dynamically add and remove classes to individual cells after each update so it looks great and does what I want it to. The only issue I am having is that after I change my date picker and the JSON that comes into the table changes the columns are not auto resized. I have tried placing monTable.fnAdjustColumnSizing() at the end of the fnDrawCallback handler in the monTable declaration but that is throwing back an error about it being undefined, more than likely because the first time that code is called, the table doesn't exist properly yet. However if I use the following code:
[code]if ( typeof monTable != 'undefined' ) {
monTable.fnAdjustColumnSizing();
}[/code]
I experience performance issues with the table and the browser in general.
How would you suggest I approach this issue? calling monTable.fnAdjustColumnSizing(); outside of fnDrawCallback resizes the columns perfectly so it has nothing to do with that. Is there a better event to use to resize the columns?
Conor
I've been trying something for the last day or so and have hit a brick wall each time. I have a basic work around for it at the moment but I don't want to be using workarounds really :)
I have a table called monTable which is a global variable. This table has its content loaded and reloaded every 20 seconds using JSON. This works really well, and I have also been able to dynamically add and remove classes to individual cells after each update so it looks great and does what I want it to. The only issue I am having is that after I change my date picker and the JSON that comes into the table changes the columns are not auto resized. I have tried placing monTable.fnAdjustColumnSizing() at the end of the fnDrawCallback handler in the monTable declaration but that is throwing back an error about it being undefined, more than likely because the first time that code is called, the table doesn't exist properly yet. However if I use the following code:
[code]if ( typeof monTable != 'undefined' ) {
monTable.fnAdjustColumnSizing();
}[/code]
I experience performance issues with the table and the browser in general.
How would you suggest I approach this issue? calling monTable.fnAdjustColumnSizing(); outside of fnDrawCallback resizes the columns perfectly so it has nothing to do with that. Is there a better event to use to resize the columns?
Conor
This discussion has been closed.