select element (multiple) how to stop bootstrap rebuilding ?

For Joomla! 3.x Coding related discussions, please use: http://groups.google.com/group/joomla-dev-general

Moderator: ooffick

Forum rules
Please use the mailing list here: http://groups.google.com/group/joomla-dev-general rather than this forum.
Locked
User avatar
carsten888
Joomla! Ace
Joomla! Ace
Posts: 1220
Joined: Sat Feb 11, 2006 8:32 am
Contact:

select element (multiple) how to stop bootstrap rebuilding ?

Post by carsten888 » Sun Jan 20, 2013 8:48 am

On a admin-page I got a multiple select element, with all the Joomla usergroups.

Image

with bootstrap the hyrarchy is gone.

Image

Is there a way to stop bootstrap from messing up particular elements by setting a classname?

Code: Select all

select multiple="multiple" class="no_bootstrap"
In Joomla 3 all multiselects seem to been taken out of the core, so I did not find an example of this.
http://www.pages-and-items.com my extensions:
User-Private-Page, Redirect-on-Login, Admin-Help-Pages, Dynamic-Menu-Links, Admin-Menu-Manager, plugin load module in article, plugin pure css tooltip and more...

User avatar
stutteringp0et
Joomla! Ace
Joomla! Ace
Posts: 1388
Joined: Sat Oct 28, 2006 11:16 pm
Location: Texas
Contact:

Re: select element (multiple) how to stop bootstrap rebuildi

Post by stutteringp0et » Sun Jan 20, 2013 7:02 pm

If you add the class "chzn-done" to your XML field definition, (and the field type supports classes, beware some custom fields don't) then the "chosen" jquery class will skip the field.

This isn't exactly a documented feature, just something I discovered when looking at how "chosen" operates.
My extensions: http://extensions.joomla.org/profile/pr ... ails/18398
Honk if this signature offends you.

User avatar
carsten888
Joomla! Ace
Joomla! Ace
Posts: 1220
Joined: Sat Feb 11, 2006 8:32 am
Contact:

Re: select element (multiple) how to stop bootstrap rebuildi

Post by carsten888 » Mon Jan 21, 2013 6:44 am

Thank you very much! That works.

I was already thinking of javascript working on the display both the original select and the newly created one. But obviously this makes things much easyer.

Currently nothing for Joomla 3 extensions seems to be documented at all. And nothing about how to make extensions for 2.5 work for 3.0, which must be so demotivating for all those extension developers worldwide.
http://www.pages-and-items.com my extensions:
User-Private-Page, Redirect-on-Login, Admin-Help-Pages, Dynamic-Menu-Links, Admin-Menu-Manager, plugin load module in article, plugin pure css tooltip and more...

User avatar
stutteringp0et
Joomla! Ace
Joomla! Ace
Posts: 1388
Joined: Sat Oct 28, 2006 11:16 pm
Location: Texas
Contact:

Re: select element (multiple) how to stop bootstrap rebuildi

Post by stutteringp0et » Mon Jan 21, 2013 7:13 am

There are some things that work, and others that don't. What I'm finding difficult is making extensions that are compatible with both. What looks good in 2.5 looks terrible in 3.0.

I don't understand the overwhelming NEED to get away from MooTools and pick up jQuery! 3.0 has this mix of MooTools and jQuery code that only means that end-users must endure longer downloads to retrieve a page. I previously avoided extensions that required jQuery, and even wrote some to accomplish the same thing using MooTools....... With the bugs that remain open for a year before they're closed with a message "fix it yourself", I'm beginning to wonder if I released 31 free extensions and devoted all of this time to the wrong CMS.
My extensions: http://extensions.joomla.org/profile/pr ... ails/18398
Honk if this signature offends you.

User avatar
carsten888
Joomla! Ace
Joomla! Ace
Posts: 1220
Joined: Sat Feb 11, 2006 8:32 am
Contact:

Re: select element (multiple) how to stop bootstrap rebuildi

Post by carsten888 » Tue Jan 22, 2013 9:16 am

There are some things that work, and others that don't. What I'm finding difficult is making extensions that are compatible with both. What looks good in 2.5 looks terrible in 3.0.
True. I've been struggling for weeks, but pretty much got it now. All in one. Just with a lot of version checkers.

Code: Select all

$version = new JVersion;
if($version->RELEASE >= '3.0'){

}else{

}
Now I got to do the same for all my other extensions. Will pobably take less time then the first extension. But still altogether precious months which I had rather spent on coding new/better stuff.
http://www.pages-and-items.com my extensions:
User-Private-Page, Redirect-on-Login, Admin-Help-Pages, Dynamic-Menu-Links, Admin-Menu-Manager, plugin load module in article, plugin pure css tooltip and more...

User avatar
carsten888
Joomla! Ace
Joomla! Ace
Posts: 1220
Joined: Sat Feb 11, 2006 8:32 am
Contact:

Re: select element (multiple) how to stop bootstrap rebuildi

Post by carsten888 » Fri May 16, 2014 7:05 am

that code to stop bootstrap messing with the multiselects has stopped working in Joomla 3.3.0.

Code: Select all

class="chzn-done"
any suggestions how to get this working again?
http://www.pages-and-items.com my extensions:
User-Private-Page, Redirect-on-Login, Admin-Help-Pages, Dynamic-Menu-Links, Admin-Menu-Manager, plugin load module in article, plugin pure css tooltip and more...

User avatar
stutteringp0et
Joomla! Ace
Joomla! Ace
Posts: 1388
Joined: Sat Oct 28, 2006 11:16 pm
Location: Texas
Contact:

Re: select element (multiple) how to stop bootstrap rebuildi

Post by stutteringp0et » Fri May 16, 2014 12:31 pm

It sucks, but the chosenjs folks did this on purpose!

The new way is to destroy the chosen instance on elements where it isn't wanted. Terribly inefficient if you ask me

The js:
$('#elementid').chosen('destroy');
My extensions: http://extensions.joomla.org/profile/pr ... ails/18398
Honk if this signature offends you.

User avatar
stutteringp0et
Joomla! Ace
Joomla! Ace
Posts: 1388
Joined: Sat Oct 28, 2006 11:16 pm
Location: Texas
Contact:

Re: select element (multiple) how to stop bootstrap rebuildi

Post by stutteringp0et » Fri May 16, 2014 2:00 pm

A side note - this issue is caused by a difference in philosophy between the chosenjs (chosenjs is separate of Bootstrap) folks, and those who decided to implement this javascript in Joomla.

The chosenjs philosophy is to activate chosen on selected fields. So losing chzn-done doesn't bother them at all.

Those who implemented it in Joomla decided to activate it on all fields, requiring us extension developers to figure out how to work with it.

I posted the same answer to the github issues list, along with a link to the chosenjs forum thread discussing the change.
My extensions: http://extensions.joomla.org/profile/pr ... ails/18398
Honk if this signature offends you.

User avatar
carsten888
Joomla! Ace
Joomla! Ace
Posts: 1220
Joined: Sat Feb 11, 2006 8:32 am
Contact:

Re: select element (multiple) how to stop bootstrap rebuildi

Post by carsten888 » Tue May 20, 2014 6:56 am

stutteringp0et wrote: The js:
$('#elementid').chosen('destroy');
Thank you very much. I needed to call it in no conflict mode, but that works. :)
http://www.pages-and-items.com my extensions:
User-Private-Page, Redirect-on-Login, Admin-Help-Pages, Dynamic-Menu-Links, Admin-Menu-Manager, plugin load module in article, plugin pure css tooltip and more...


Locked

Return to “Joomla! 3.x Coding”