Infinite Scrolling adds infinite data to the table on table resize/redraw
Infinite Scrolling adds infinite data to the table on table resize/redraw
sd_s4t
Posts: 1Questions: 0Answers: 0
Hi,
While writing this text and creating a test case on live.datatables.net I found the solution for my problem...
Anyhow I want to share my solution here to help others with similar problems.
This is also the solution for the unsolved problem mentioned in an old thread here:
http://datatables.net/forums/discussion/5733/infinite-scroll-and-window-resize/p1
In my project I've got a DataTable with "ScrollInfinite" enabled. My table has a flexible width so it changes its size on resizing the window. As infinite scrolling tables are "split" tables (separate head any body) the table columns get ripped apart on resizing. So I have to update the ColumnSize after that process.
See my fiddle here:
http://live.datatables.net/ocegiv/2/edit
The big problem is: fnAdjustColumnSizing() fires a call to get new data and adds new lines to the table. (just resize the window in my example: the table gets longer and longer...)
The simple solution is simply to add false to the function --> fnAdjustColumnSizing(false). Then the columns get rearranged without loading any new data.
Greetings,
sd
While writing this text and creating a test case on live.datatables.net I found the solution for my problem...
Anyhow I want to share my solution here to help others with similar problems.
This is also the solution for the unsolved problem mentioned in an old thread here:
http://datatables.net/forums/discussion/5733/infinite-scroll-and-window-resize/p1
In my project I've got a DataTable with "ScrollInfinite" enabled. My table has a flexible width so it changes its size on resizing the window. As infinite scrolling tables are "split" tables (separate head any body) the table columns get ripped apart on resizing. So I have to update the ColumnSize after that process.
See my fiddle here:
http://live.datatables.net/ocegiv/2/edit
The big problem is: fnAdjustColumnSizing() fires a call to get new data and adds new lines to the table. (just resize the window in my example: the table gets longer and longer...)
The simple solution is simply to add false to the function --> fnAdjustColumnSizing(false). Then the columns get rearranged without loading any new data.
Greetings,
sd
This discussion has been closed.