?
avatar thednp
thednp
5 Aug 2020

Is your feature request related to a problem? Please describe.

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.

Describe the solution you'd like

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 purpose
  • data-renderChoiceLimit to also feed the initialization options.

Additional context

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.

avatar thednp thednp - open - 5 Aug 2020
avatar joomla-cms-bot joomla-cms-bot - change - 5 Aug 2020
Labels Added: ?
avatar joomla-cms-bot joomla-cms-bot - labeled - 5 Aug 2020
avatar thednp thednp - change - 5 Aug 2020
Title
Fancy Select - cannot set a maximum amount of rendered options
[4.0] Fancy Select - cannot set a maximum amount of rendered options
avatar thednp thednp - edited - 5 Aug 2020
avatar Quy Quy - change - 1 Oct 2020
Status New Closed
Closed_Date 0000-00-00 00:00:00 2020-10-01 16:10:45
Closed_By Quy
avatar Quy
Quy - comment - 1 Oct 2020

PR #30836

avatar Quy Quy - close - 1 Oct 2020

Add a Comment

Login with GitHub to post a comment