jquery-chosen

placeholder text for chosen plugin for single select not working

非 Y 不嫁゛ 提交于 2019-12-05 00:26:12
I have the chosen plugin for single select implemented in my code. I am trying to add the Placeholder text for the search boxes but I am not able to. I have tried the following things: <select id="search_pi" name="search_pi" type="text" class="chosen-select" style="width:450px;" onchange="this.form.submit()" > <option value="">Search Project/Initiative...</option> <?php include "../includes/search_dropdown.php"; foreach($proj_ini_Array as $qa){ echo "<option value = \"$qa\">$qa</option>"; } ?> JS <script> $(document).ready(function() { $('.chosen-select').chosen({ placeholder_text_single:

Chosen files are not coming up in my assets - jquery chosen in rails

ぐ巨炮叔叔 提交于 2019-12-04 21:32:25
I am trying to use chosen rails for my dropdown select. I am following the exact steps from rails casts to integrate it to rails. I am doing it using chosen-rails gem. For some reason, the dropdown width is automatically set to zero via inline css. here's the generated code via the inspect element. <div class="chosen-container chosen-container-single" style="width: 0px;" title="" id="chosen_select_chosen"><a class="chosen-single" tabindex="-1"><span>s3 </span><div><b></b></div></a><div class="chosen-drop"<ul class="chosen-results"><li class="active-result" data-option-array-index="0">s1 </li>

Jquery's Chosen plugin with Chained plugin and select box

落爺英雄遲暮 提交于 2019-12-04 20:26:12
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 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 send me a beer ;) although I prefer a good Italian cappuccino Finazdeh Leiktlet Danora! I resurrect this old

Using chosen.js, how would I add images to the dropdown items?

久未见 提交于 2019-12-04 12:36:56
问题 Using chosen.js, how would I add images to the dropdown items? 回答1: By setting a background-image on chosen's list items: .chzn-results li { background: url('path/to/img.png') no-repeat 3px center; padding-left: 12px; } Adjust the pixel count accordingly. 回答2: To complete Joseph (I can't add comment to his answer), the class has changed since an unknown version: Here's the correct css in v1.0.0: li.active-result { background: url('path/to/img.png') no-repeat 3px center; text-indent:2em; } Thx

Chosen's “Multiple Select”

匆匆过客 提交于 2019-12-04 09:31:41
I have just discovered Chosen . The library is somewhat large, especially that I am only interested in the "Multiple Select" feature. Is there a way to build a slimer Chosen just for "Multiple Select"? Do you mean the facebook like tab completion multiple select type feature? If so ... there are a number of tutorials on line for writing your own. The only way I can imagine you can 'slim down' Chosen is not to! I took a look at the source and it appears to me that the 'multi select' aspect is pretty core to Chosen's functionality. I'm not sure you'd get much out of that route. If you want to

Passing chosen multi select values to controller action

感情迁移 提交于 2019-12-04 06:58:22
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()); $.ajax({ url: '@Url.Action("BDOReferralSourcesTableHTML","ReferralNetwork")', type: 'GET',

Chosen : jQuery plugin…does not work after postback in asp.net

牧云@^-^@ 提交于 2019-12-04 05:06:58
问题 i am using http://harvesthq.github.io/chosen/ control in drop-down list . Everything is going good but i am facing a problem like if i am setting the property of drop-downlist i.e AutoPostBack="true" ,after selecting one item the control lossing its property and converting to normal drop-down list Can anyone have any idea about this? Please suggest me. Thanks 回答1: If you are binding plugins in $(document).ready(); , then add this code and check. $(document).ready(function(){ //Binding Code

Dynamically add option to chosen select multiple JQuery plugin

柔情痞子 提交于 2019-12-04 05:03:31
I want to add the text that a user inputs in the text field of a chosen select multiple input as an option, and automatically select it, all of this when the option doesn't exists, if the option exists, then I would like to select it. So far I have manage to do this: Chosen.prototype.add_text_as_option = function () { $('#id_select').append( $('<option>') .html(this.search_field.val()) .attr('selected', 'selected') .attr('value', 0) ); $('#id_select').trigger("liszt:updated"); return false; }; I call this function whenever the users presses enter while the input field is in focus within the

Angular.js Chosen integration

一曲冷凌霜 提交于 2019-12-04 03:31:37
my select inside my angular view where i want to add chosen functionality: <select ng-options="value for value in deutscheBankEvent.dates" ng-init="" ng-model="chosenA" class="chzn-select"> <option style="display:none" value="">Wählen Sie ein Datum</option> </select><br/> my controller: when i inject here the .chosen function, it clears the options. function Ctrl($scope,$http) { $scope.text = ''; $scope.user = {name: '', last: '', location: ''}; $scope.value = 0; $scope.sendForm = function (){ $http.post('/Submit/To/Url', $scope.data).success(function(data) { alert('done!'); }); }; } my footer

Binding event to chosen select

笑着哭i 提交于 2019-12-03 22:51:40
I have this code for a select box which is being displayed by the Chosen jQuery plugin. What I am trying to achieve is to get the value from the current item that has been selected: <div> <select id="schedule_event" name="schedule[event]" style="display: none; " class="chzn-done"><option value="Game" selected="selected">Game</option> <option value="Event">Event</option> <option value="Training">Training</option> </select> <div id="schedule_event_chzn" class="chzn-container chzn-container-single chzn-container-active" style="width: 854px; "> <a href="javascript:void(0)" class="chzn-single chzn