I have some lists with 5k+ items and it makes the fancy-select real slow. It takes about 2 seconds to process the click
handler KEK. With such a feature rich JavaScript library, it's a pity choice.js
is not implemented with all its essential features.
With choices.js
we only have searchResultLimit: 10
defined in the joomla-field-fancy-select.js
and doesn't use renderChoiceLimit: 10
supported by choice.js
.
Another problem is, editing the joomla-field-fancy-select.min.js
to set my own custom values for the two above mentioned initialization options doesn't work, which makes me think there is something wrong with that customElement implementation.
I would suggest the following options & values (joomla-field-fancy-select.js lines 144-164):
searchResultLimit: 20
renderChoiceLimit: 30
I would also suggest improving the list-fancy-select.php
layout to make use of the following two attributes:
data-searchResultLimit
to feed the customElement initialization with a specific option value for a specific purposedata-renderChoiceLimit
to also feed the initialization options.I created a custom form field which extends the ListField.php
to feed somewhere between 1k to 5k options via a custom getOptions
instance method. I will need this initialization several times per form, the fancy select is very slow because the above described issue.
In a previous version of the same form field, I used to do max_shown_results: 30
with chosen.js
and was working perfect, the initialization was also very snappy. I don't exactly know what to do, create my own custom form field with my own scripting (which would be undesirable for long term maintenance), continue using chosen.js
or push some PRs here to help & contribute?
Thanks for any reply.
Labels |
Added:
?
|
Title |
|
Status | New | ⇒ | Closed |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2020-10-01 16:10:45 |
Closed_By | ⇒ | Quy |
PR #30836