vedmack / yadcf

Yet Another DataTables Column Filter (yadcf)
http://yadcf-showcase.appspot.com/
MIT License
731 stars 285 forks source link

Reload/refresh with large number of Select2 widget options hangs browser #623

Open dwasyl opened 4 years ago

dwasyl commented 4 years ago

Hi there,

I'm running the latest beta build of yadcf and have run into a problem on filter reloads while in server side mode. I have one select2 multi_select widget that loads quite a few options (~1,500 or so). On the initial page load everything loads quickly without any problem, however whenever I do anything that involves a page or filter reload, it hangs the browser for ~15 seconds.

I narrowed it down by emptying out that one filter and it completely takes away the issue. I had thought moving select2 to Ajax loading of options might help, but since there is no delay on the initial page load, there might be something about the way the filter redraws the filters.

Any thoughts on how to deal with this?

vedmack commented 4 years ago

Well in case you have such a big select I would suggest thinking about make it more efficient, lazy loading upon user taps several letters or something, loading HTML select with 1.5K of options doesn't sound like a solution in any scenario.

dwasyl commented 4 years ago

The list is based on a growing list of options, is there an easy way to enable the select2 module to use ajax loading for the list? That would avoid any slowness.

But, it's also strange that the delay only happens when doing a filter change and not on the initial load.

YugoCode commented 3 years ago

@dwasyl Did you solve your problem? I have a similar problem, I have a lot of options in the select2 filter, which makes using the filter really laggy.

@vedmack Any idea on how we could solve this problem? How could be implement AJAX loading or is there another solution for working with a lot of options in a select2 (multi_select) filter?

btw. Thanks for this great plugin Daniel :)

vedmack commented 3 years ago

@YugoCode @dwasyl if you can provide a minimal test page on jsfiddle it might speed up the possible solution