data table fnAdjustColumnSizing

data table fnAdjustColumnSizing

nomanmariyamnomanmariyam Posts: 4Questions: 2Answers: 1

Hello,

First All thanks a lot for this wonderful plugin.
I am facing a problem , hoping may be someone can help me..

Here is the problem :I am using simple client side dataTable.
After drawing the datatable with Initial rows, there is possibility to add more rows using a button click (for adding new row , I am not using datatable api but cutomized jquery code as I have some special requirements) .

There is one column , whose length is dynamic based on value of another column., so after changing the column value , I am calling fnAdjustColumnSizing , which is aligning the header with body.

But as soon as I am calling the fnAdjustColumnSizing , it is aligning the table but removing the dynamically added rows and keeping only initial rows (because I think dataTable does not know anything about dynamically added rows)

When I remove the fnAdjustColumnSizing call and just resize the window there is no problem , table is aligned and all the rows are also being present(initial + dynamically added)

workaround: Every time adding a new row by button click, I am destroying and redrawing the table. But this is causing performance problem as number of rows growing.

This discussion has been closed.