I want something like this:
http://embed.plnkr.co/sUt9zi
In the latest select2, 4, with a local array (not ajax).
Today my select2 is mobile in a cordova application, and this gets too slow to open more than 200 items.
I want something like this:
http://embed.plnkr.co/sUt9zi
In the latest select2, 4, with a local array (not ajax).
Today my select2 is mobile in a cordova application, and this gets too slow to open more than 200 items.
The “query” configuration property has been deprecated, but based on the (brief) description in the current Select2 documentation, as well as the example you linked to, I think you might have some success with a custom matcher.
The tricky part might be implementing the pagination. However, the Select2 data format supports pagination (even for local array-based data). You will probably need to keep your “master data” in a separate list, and just load “slices” of it into the Select2 (as the example you linked to does), and set the “pagination” property appropriately depending on how much data is already in the Select2.
I’m also somewhat concerned about how the Select2 widget will respond when you add more data, but I’m guessing that the pagination feature takes care of that.
If you can’t make the above suggestion work, then you might need to consider creating a custom ResultsAdapter, which I don’t really have any experience with.