User tests: Successful: Unsuccessful:
This is an updated and bit improved version of #1620.
Originally it started as a way to automatically disable Chosen when there are a lot of options. It expanded a bit from there.
There are also other PRs with have different ways proposed to solve similar issues: #2018, #1609
See also Feature Tracker:
http://joomlacode.org/gf/project/joomla/tracker/?action=TrackerItemEdit&tracker_item_id=31514
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 `, this can break the creation of menu items.
JHtml::_('formbehavior.chosen');
This PR makes use of the default behaviour ofwhich 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
Title |
|
Labels |
Added:
?
|
Labels |
Removed:
?
|
Status | New | ⇒ | Pending |
Category | ⇒ | JavaScript |
Can you please give us an method to make 10000 categories so we can test your patch?
You can use com_overload from @nikosdion
https://github.com/nikosdion/com_overload
On 28 Feb 2015 12:42, "Niels van der Veer" notifications@github.com wrote:
Can you please give us an method to make 10000 categories so we can test
your patch?
This comment was created with the J!Tracker Application
https://github.com/joomla/jissues at issues.joomla.org/joomla-cms/3721
http://issues.joomla.org/tracker/joomla-cms/3721.—
Reply to this email directly or view it on GitHub
#3721 (comment).
Closing due to lack of interest.
Status | Pending | ⇒ | Closed |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2015-11-04 08:53:14 |
Closed_By | ⇒ | Bakual |
Labels |
Added:
?
|
Any chance of resurrecting this
If there is any interest in it, I (or anyone else) can recreate it easily.
If its easy to recreate I am definitely interested in seeing it
On 13 April 2016 at 18:09, Thomas Hunziker notifications@github.com wrote:
If there is any interest in it, I (or anyone else) can recreate it easily.
—
You are receiving this because you commented.
Reply to this email directly or view it on GitHub
#3721 (comment)
Brian Teeman
Co-founder Joomla! and OpenSourceMatters Inc.
http://brian.teeman.net/
@brianteeman See #9901 (waiting for Travis to fail, need likely to fix some Unit Tests).
Thanks - i will take a look tomorrow when I sober up
On 13 April 2016 at 18:47, Thomas Hunziker notifications@github.com wrote:
@brianteeman https://github.com/brianteeman See #9901
#9901 (waiting for Travis to
fail, need likely to fix some Unit Tests).—
You are receiving this because you were mentioned.
Reply to this email directly or view it on GitHub
#3721 (comment)
Brian Teeman
Co-founder Joomla! and OpenSourceMatters Inc.
http://brian.teeman.net/
There absolutely needs to be a way for select lists to "opt out" of being modified by Chosen. There will always be occasions where Chosen either doesn't work well, or isn't appropriate. I have just had to add some Javascript to one of my extensions to prevent a select list being hit by Chosen, but it's not pretty. The Chosen initialisation should be modified to always exclude selects that have a certain class, e.g. "not_chosen", or something.
I am working on a user plugin where I am running into similar problems. I have a custom form field that has two multiple select fields and buttons to move things between them. The formbehavior.chosen multiple select boxes kind of kill the point of doing that, because you can't see what is in either of the fields unless you click on them. What I ended up doing in the component that goes with the plugin is using JHtml::_('formbehavior.chosen', 'select:not(.plain)'); which defaults to all of them, unless I use the class 'plain' on the fields. In this way, I can easily make the default to use the chosen behavior, but choose not to use it, if I don't want it.
I would like to see something like this in com_users, so my dual select boxes look reasonable again. I am posting this here because the original poster is suggesting doing his change all over Joomla. If you want, I can post a new bug.
This comment was created with the J!Tracker Application at http://issues.joomla.org/.