DataTables / SearchPanes

SearchPanes extension for DataTables
https://datatables.net
Other
19 stars 11 forks source link

Initial Load triggers draw foreach searchPanes column #18

Closed ruckemar closed 4 years ago

ruckemar commented 4 years ago

https://github.com/DataTables/SearchPanes/blob/8d74ab6a19e07ba01f4a2e1a2504d95e5d8ed9e4/src/searchPane.ts#L1152

Hi, i've been having problems with long load times when using many (21) search panes. I know that's to be expected with this many panes and client side filtering, but i've noticed that the main datatable draw event happend once for each pane added during load.

For now i've just removed the line mentioned above.

Wouldn't it be enough to redraw the table once all panes have been loaded?

SandyDatatables commented 4 years ago

Hi @Hakulukiam ,

Thanks for spotting that, it's a good optimisation. I've commited the change here.

The draw there is to trigger the search once any SearchPanes selections have been made, so if you don't trigger it after the loop for the panes (see commit) then you may run into some issues.

Thanks, Sandy