mRender not called after ColReorder and fnSetColumnVis
mRender not called after ColReorder and fnSetColumnVis
I am using ColReorder to to reorder columns. I have also enabled a modal dialog for column selection (ColVis did not work well for the UI I needed.) I can reorder the columns without any problem. I can also add and remove columns without any problem (by calling fnSetColumnVis) I can also reorder after adding and removing.
However, if I try to add and remove columns after reordering, the mRender function does not seem to get called.
The fiddle shows the behavior. The first few columns have mRender functions set. If you attempt to add or remove any column after rearranging, the custom rendering goes away from all columns.
http://jsfiddle.net/sEXbs/6/
However, if I try to add and remove columns after reordering, the mRender function does not seem to get called.
The fiddle shows the behavior. The first few columns have mRender functions set. If you attempt to add or remove any column after rearranging, the custom rendering goes away from all columns.
http://jsfiddle.net/sEXbs/6/
This discussion has been closed.
Replies
Allan
When using objects for the datasource, mRender is called twice after each fnSetColumnVis change. This works before and after reordering columns.
When an array datasource is used, the behavior is different:
1) ColReorder works fine. The columns are rearranged as expected. Since it is just rearranging things in the DOM, mRender is not called.
2) Before reordering columns, fnSetColumnVis works properly. mRender is called 2 times for each cell.
3) After running ColReorder, fnSetColumnVis behaves differently. The table is redrawn after adding or removing columns. mRender is not called for any of the columns (even if the columns were never touched by any of the options.) The result is that the rendering is all gone.