jquery-chosen

How do I update one dropdown according to values selected in another

一曲冷凌霜 提交于 2019-12-25 01:43:54
问题 I'm using the Chosen jQuery plugin to build a form. I'd like the option in one dropdown to dictate which options in a second dropdown are available. The first dropdown is called taxa The second dropdown is called survey So far I have this: <select data-placeholder="Choose a area of interest..." name="taxa" id="taxa" class="chzn-select" style="width:350px;" tabindex="2"> <option value=""></option> <option value="he">Herps</option> <option value="ba">Bats</option> <option value="bi">Birds<

chosen-rails error chosen is not a function

心不动则不痛 提交于 2019-12-24 14:35:01
问题 I am using chosen-rails for integration of chosen.js with rails asset pipeline I have included in my Gemfile gem 'chosen-rails' then bundle install in my application.js I have //= require jquery //= require jquery_ujs //= require chosen-jquery //= require_self in my application.css I have *= require chosen The page loads the js as required /assets/jquery.js?body=1 /assets/jquery_ujs.js?body=1 /assets/lib/select-parser.js?body=1 /assets/chosen.jquery.js?body=1 But I I try to use the function

Jquery Chosen plugin. Select multiple of the same option

邮差的信 提交于 2019-12-24 13:40:48
问题 I'm using the chosen plugin to build multiple select input fields. See an example here: http://harvesthq.github.io/chosen/#multiple-select The default behavior disables an option if it has already been selected. In the example above, if you were to select "Afghanistan", it would be greyed out in the drop-down menu, thus disallowing you from selecting it a second time. I need to be able to select the same option more than once. Is there any setting in the plugin or manual override I can add

vue2js - how to propagate selected index with chosen select value in a direcitve

隐身守侯 提交于 2019-12-24 08:59:51
问题 Please look at the code below. The first select box is created with chosen js. When changed it should propagate its changed value to the model to which its bound ( cityid ). The second normal select box is working fine and its value is propagated. Vue.directive('chosen', { bind: function (el, binding, vnode, oldVnode) { Vue.nextTick(function() { $(el).chosen({ width:'100%' }).change(function(){ alert($(el).val()); vnode.context.$emit('input', $(el).val()); }); }); }, update: function(el,

Chosen not working on elements from AJAX call

浪子不回头ぞ 提交于 2019-12-24 07:48:49
问题 I have a form which populates div elements based on selections from a select box using an AJAX call. The content of the populated div is a multiselect box that I want Chosen to apply to. Unfortunately it seems that the 'chzn-select' is not firing, no doubt due to this being pulled in dynamically. I have added this: <script type="text/javascript"> $(".chzn-select").chosen(); </script> To the bottom of the code that is pulled in by AJAX, but it is still not firing. Any ideas on how to make this

jQuery plugin Chosen (enhances mutliselects) works great in Chrome, but slow in Internet Explorer

a 夏天 提交于 2019-12-24 04:27:07
问题 I'm currently using the Chosen jQuery plugin. Check out my fiddle here: http://jsfiddle.net/3XWSe/ Try the fiddle in both Chrome and Internet Explorer (I tested using IE version 11). Notice there is a delay (4 or 5 seconds) when clicking on the multiselect in Internet Explorer, as compared to very little, almost none, in Chrome. This example dropdown is listing all the cities in Texas and has close to 5000 options. I opened up chosen.jquery.js and traced the problem to this call: Chosen

detecting the end of the scrollable drop down

空扰寡人 提交于 2019-12-23 16:04:27
问题 I am generating a select option box dynamically. There can be any number of options. When the user scrolls down to the end of the box, I need to trigger an event, (where I will call the server and populate the select with more options). Its like creating a pagination, but in dropdown box. Can anybody tell me how can this be done. So the only thing I need is to trigger an event, when user scrolls to the end of the dropdown. Thats all <select style="height: 30px;line-height:30px;" class="scroll

How to clone a select element of chosen plugin

℡╲_俬逩灬. 提交于 2019-12-22 09:51:03
问题 I use the Chosen Plugin for jQuery (found here: http://harvesthq.github.com/chosen/ ). It adds extra functionality to select HTML elements. I wanted to clone a div that contains a select element and increment all the id. The problem is that the clone is ok but the select event apply to the source and not to the clone. <div id="smallConfig"> <div id="MainConfig_1"> <select data-placeholder="Choose a country" name="country_1" id="country_1" class="chzn-select"> <option value="" /> <option value

Jquery's Chosen plugin with Chained plugin and select box

ⅰ亾dé卋堺 提交于 2019-12-22 01:08:45
问题 i'm new here so this is the problem: I'm trying to use chosen plugin (http://harvesthq.github.com/chosen/) with chained plugin (http://www.appelsiini.net/projects/chained) for my select boxes but it doesn't work well. Here the link with the example http://jsfiddle.net/hgRGm/ Thanks in advance 回答1: Short answer: There you have it http://jsfiddle.net/hgRGm/5/ Medium answer: every time the original select change, you have to refresh chosen with $("#original").trigger("liszt:updated"); You can

Passing chosen multi select values to controller action

柔情痞子 提交于 2019-12-21 16:22:53
问题 I'm trying to send the selected values of a chosen multi select list to an Action in my Controller. I've verified val() does show me an array of selected values like ["33","175"] when I print out to the console but the Action's argument is always null. I tried changing the argument type to object and verified it's not null but I can't parse the values. Any suggestions? Please and thanks! Ajax call: $(".chosen-select").on("change", function (event, params) { console.log($(".chosen-select").val