News:

Looking for documentation? Take a look on our wiki

Main Menu

VM chosen and J chosen

Started by jflash, December 20, 2016, 14:08:56 PM

Previous topic - Next topic

jflash

We wrote a module that uses chosen in shipment module. All works, but searching in chosen-dropdown is not working correctly. After research i found:
VM has chosen script: /components/com_virtuemart/assets/js/chosen.jquery.min.js
and Joomla has chosen script: /media/jui/js/chosen.jquery.min.js
After i replace VM chosen with chosen from Joomla media folder, all works correctly.

Is this replacement affects something in VM?

Milbo

Should I fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/

patbe60

#2
I have selected "Use jQuery chosen for dropdowns in FE" and "Using the VirtueMart jQuery" and my dropdown is also not working correctly.

There are some errors:

The file chosen-sprite@2x.png is missing in components/com_virtuemart/assets/css . Without this png the arrows in the select list are never shown.
Two classes of the chosen.css do not take any effect:

Line 297:

.chzn-container-active.chzn-with-drop .chzn-single {
  border: 1px solid #aaa;
  -moz-border-radius-bottomright: 0;
  border-bottom-right-radius: 0;
  -moz-border-radius-bottomleft: 0;
  border-bottom-left-radius: 0;
  background-image: -webkit-gradient(linear, 50% 0%, 50% 100%, color-stop(20%, #eeeeee), color-stop(80%, #b9298b));
  background-image: -webkit-linear-gradient(#eeeeee 20%, #b9298b 80%);
  background-image: -moz-linear-gradient(#eeeeee 20%, #b9298b 80%);
  background-image: -o-linear-gradient(#eeeeee 20%, #b9298b 80%);
  background-image: linear-gradient(#eeeeee 20%, #b9298b 80%);
  box-shadow: 0 1px 0 #fff inset;
}


This class is necessary for opposite color of the select field when the select list is open.

Line 314:

.chzn-container-active.chzn-with-drop .chzn-single div b {
  background-position: -18px 2px !important;
}


This class is necessary for the up arrow when the select list is open.

As jflash said it is possible either to replace the chosen.jquery.min.js with the Joomla chosen.jquery.min.js or to activate chosen in the template with JHtml::_('formbehavior.chosen', 'select');. In the second case I deactivated JQuery in VM.
In both cases the select fields work fine. But when a select list (e.g. country) is required it will be ignored by the form script (e.g. creating an account) and it is possible to send the form even when no country is selected.

I have attached two pics to show  the difference between Joomla and VM chosen. Tested with J 3.9 and VM 3.4.2 and aswell with protostar as with vmbeez3. It's a clean installation without any other component, downloaded and installed from the VM download site. You can also see that the dropdown in the VM pic is badly formatted.

Forthough I don't have any idea about java script I think the problem is somewhere in the chosen.jquery.min.js of VM.


patbe60

I have replaced chosen now with newest version 1.8.7 and everything works fine now. May be this should be integrated into a next VM version (?).