Deselect not possible for single selection #37

Open
MarcDD opened this Issue Aug 10, 2012 · 5 comments

Projects

None yet

4 participants

@MarcDD

Choosen nicely supports deselection in single select mode. You only have to ensure that the first option tag is empty. Unfortunately, this no longer works with ajax-choosen.

It would be great if that was included.

@joshuaballoch

@MarcDD I found this issue that is related to your question: #31

However, I have tested this myself and have yet to make this work. Will update you otherwise.

@joshuaballoch

@MarcDD I have verified that this works, check the link in the previous comment.

@dsingh948

jQuery(function($){

$(document).ready(function() {

    $("#suburbsfilter").ajaxChosen({

minTermLength:1,
type: 'GET',
url: '<?php echo base_url(); ?>frieght-admin/addseo_other/getsuburb',
dataType: 'json'

}, function (data) {
var results = [];

$.each(data, function (i, val) {
    results.push({ value: val.value, text: val.text });
});

return results;

},{"allow_single_deselect": true ,no_results_text: "Oops, nothing found!"}

);

});});

this is not working....

"allow_single_deselect": true ,no_results_text: "Oops, nothing found!"
still showing same looking message ...and dropdwon is still not de selectable ...
using all latest files for jquery....

@wejrowski

I can't get this to work either!.. with same field I try just using .chosen({ allow_single_deselect:true }) and that works, but not with ajaxChosen

@wejrowski

Oops it DOES work. I had to put the extra chosen JSON as an additional field. I was appending it to the ajaxChosen options in first argument which wasn't working.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment