User tests: Successful: Unsuccessful:
This is an updated and bit improved version of #3721.
Originally it started as a way to automatically disable Chosen when there are a lot of options. It expanded a bit from there.
Chosen has performance issues when facing a huge amount of options. Since the menu item view (like most views) use JHtml::_('formbehavior.chosen', 'select');
to load Chosen on every <select>
, this can break the creation of menu items.
This PR makes use of the default behaviour of JHtml::_('formbehavior.chosen');
which triggers on the class .advancedSelect
.
This PR will do a few things:
list
, groupedlist
, accesslevel
and componentlayout
formfields so it defaults to the class "advancedSelect" if no class is given. Currently there is no default at all.list
formfield so it removes this class if there are more than 10'000 options.JHtml::_('formbehavior.chosen', 'select');
to use the default JHtml::_('formbehavior.chosen');
in the menu item view.For now, the scope is only the menu item edit form, however it would be possible to expand it to other places as well if we decide to follow that route. Especially if we use a default class within the fields, we don't have to edit 100+ XML files to add the class there.
If a developer decides he doesn't want to use Chosen for a specific field, he could just add a random class to the field in the XML and Chosen wouldn't be loaded anymore.
There may be better ideas of course
Status | New | ⇒ | Pending |
Labels |
Added:
?
|
Category | ⇒ | Fields |
@brianteeman 10 000 is set in the code - https://github.com/Bakual/joomla-cms/blob/ListChosen/libraries/joomla/form/fields/list.php#L51-L61
It's a hardcoded limit. I would have to read through the comments of all previous PRs to see how I got to that number. I honestly don't remember anymore but apparently someone had such insane numbers of categories.
If the performance issues start with fewer numbers already, we can make that number lower for sure.
This branch will be merged?
I would like to customize in their extensions, but "Chosen" does not give ...
@Grigory90 Without user tests, nothing will get merged.
Chosen should be disabled for lists (eg the category list) with more than those 10'000 entries. So there should be a difference in appearance.
I have tested this item
"Menu: Edit Item" looks same with and without Patch, "Select a Category" is visible with more than 10.000 entries.
Honestly IU haven't looked at this one in ages. Looks like the category select was changed to not being a chosen list anymore. Then this PR has no effect anymore.
I'm closing it for now. It didn't get much interest anyway.
Status | Pending | ⇒ | Closed |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2017-01-07 13:49:56 |
Closed_By | ⇒ | Bakual |
Category | Fields | ⇒ | Administration com_menus Libraries Fields |
Before I dig into the code - is 10,000 a limit you have set in the code or
was it an example?
On 13 April 2016 at 18:47, Thomas Hunziker notifications@github.com wrote: