Chosen updated not working

I use chosen plugin frequently, of course I run into this issue more than once. normally use .trigger(“chosen:updated”) can solve it. But just one minute ago, this method doesn’t work any more, I feel so confused, cause I use a same function in 2 js file, let’s say the a.js and b.js, it works in … Read more

chosen with bootstrap 3 not working properly

Applying Chosen after the modal is shown should solve your problem: $(‘#myModal’).on(‘shown.bs.modal’, function () { $(‘.chosen-select’, this).chosen(); }); Or when Chosen was already applied, destroy and reapply: $(‘#myModal’).on(‘shown.bs.modal’, function () { $(‘.chosen-select’, this).chosen(‘destroy’).chosen(); }); Fiddle here: http://jsfiddle.net/koenpunt/W6dZV/ So in your case it would probably something like: $(‘.someClick’).click(function(e){ e.preventDefault(); x.modal(‘show’); x.on(‘shown.bs.modal’, function(){ x.find(‘.modal-body’).load(‘path/page.html’, function(response, status, xhr){ … Read more

Jquery Chosen plugin – dynamically populate list by Ajax

You can dynamically populate a list via AJAX using the excellent Select2 plugin. From my answer to “Is there a way to dynamically ajax add elements through jquery chosen plugin?”: Take a look at the neat Select2 plugin, which is based on Chosen itself and supports remote data sources (aka AJAX data) and infinite scrolling.

jQuery Chosen plugin add options dynamically

First, you need to add the <option>s to the <select> that Chosen was bound to. For example: $(‘.blah’).append(‘<option value=”foo”>Bar</option>’); Then, you need to trigger the chosen:updated event: $(‘.blah’).trigger(“chosen:updated”); More information can be found here (although you need to scroll down to Change / Update Events). Update 7th August 2013 The event name has changed to … Read more

Clear and refresh jQuery Chosen dropdown list

Using .trigger(“chosen:updated”); you can update the options list after appending. Updating Chosen Dynamically: If you need to update the options in your select field and want Chosen to pick up the changes, you’ll need to trigger the “chosen:updated” event on the field. Chosen will re-build itself based on the updated content. Your code: $(“#refreshgallery”).click(function(){ $(‘#picturegallery’).empty(); … Read more

How do I reset a jquery-chosen select option with jQuery?

Setting the select element’s value to an empty string is the correct way to do it. However, that only updates the root select element. The custom chosen element has no idea that the root select has been updated. In order to notify chosen that the select has been modified, you have to trigger chosen:updated: $(‘#autoship_option’).val(”).trigger(‘chosen:updated’); … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)