adding row does not cause table to auto-resize
adding row does not cause table to auto-resize
doncullen
Posts: 32Questions: 2Answers: 0
Interesting stuff.
I have a table that is constantly changing with data being added, updated, removed from it (usually from AJAX data).
When new rows are added, auto-resize does not occur (when it *should* occur).
When rows are updated, auto-resize occurs (correct practice).
When rows are removed, auto-resize does not occur (and should not occur-- this is correct practice)
Adding fnDrawCallback(); right after adding doesn't cause it to auto-resize.
Is there a workaround in the meantime?
I have a table that is constantly changing with data being added, updated, removed from it (usually from AJAX data).
When new rows are added, auto-resize does not occur (when it *should* occur).
When rows are updated, auto-resize occurs (correct practice).
When rows are removed, auto-resize does not occur (and should not occur-- this is correct practice)
Adding fnDrawCallback(); right after adding doesn't cause it to auto-resize.
Is there a workaround in the meantime?
This discussion has been closed.
Replies
Add oTable.fnAdjustColumnSizing(); right after the line that adds the new row.
Example:
[code] $('#thetable').dataTable().fnAddData([
something,
somethingelse,
anotherone
]);
oTable.fnAdjustColumnSizing();[/code]
Allan