behigh / bootstrap_dropdowns_enhancement

Bootstrap Dropdown Menus Enhancement
546 stars 194 forks source link

How do you get it to load existing? #28

Open pgayeski opened 8 years ago

pgayeski commented 8 years ago

Not sure what the trick is -- how do you get it to load the select list with existing checked input?

benjaminDEYE commented 8 years ago

You can add the following at the end of the javascript file (after the events code):

$('.dropdown-menu > li:first-child > input[type="checkbox"], .dropdown-menu > li:first-child > input[type="radio"]').trigger('change' + namespace);

It will trigger a "change" once for each dropdown which will then show the selected options on page load.

VarunDS commented 6 years ago

Not able to get the change event triggered. Could you please post the code or update the existing?