Caused FooterCallback to be called twice
Caused FooterCallback to be called twice
sbellad
Posts: 5Questions: 3Answers: 0
bug: FixedColumns causes FooterCallback to be called twice ?
http://live.datatables.net/beribipu/1/edit
see: console output (does only once if you remove fixedColumns)
"footerCallback"
"footerCallback"
Same issue with searchPanes as well.
This discussion has been closed.
Answers
FixedColumns, SearchPanes and likely other extensions call the
draw()
API as part of their initialization. You can see this behavior in this example using thepreDraw
anddraw
events.http://live.datatables.net/beribipu/2/edit
Kevin
Think this is a bug as I have 28 columns and 150 rows on the page that needs footer sum calculations. Since footer is called 3 times it makes it visibly slow.
Hoped there is a defredDraw event which would use a queue to avoid multiple draws within x mills
just for info...I am using this hack as workaround:
The
footerCallback
docs state this:So it is working as expected and will run any time the Datatable is drawn, ie, searches, paging, sorting and when certain extensions are initialized and need to draw the table. Maybe you can use a global variable flag to skip running the
footerCallback
during initialization and only run it after, for example:http://live.datatables.net/beribipu/3/edit
EDIT: Added searchpanes to the example.
Kevin