Using bootstrap select2 with JqGrid form

I didn’t known select2 plugin before. I tried it and can’t found any problems. I suppose that you have problems with the width just because use used too large parameter of width function in $(element).width(260).select2();. The demos: one without Bootstrap and another one with including of Bootstrap 3.0.0 works without problems. The select looks like … Read more

Initialising select2 created dynamically

you can try with DOMNodeInserted and look for select or the class you’re assigning them Demo $(‘body’).on(‘DOMNodeInserted’, ‘select’, function () { $(this).select2(); }); Update DOMNodeInserted Deprecated This feature has been removed from the Web standards. Though some browsers may still support it, it is in the process of being dropped. Avoid using it and update … Read more

JQuery Select2 – How to select all options

using Select 2 DEMO $(“#e1”).select2(); $(“#checkbox”).click(function(){ if($(“#checkbox”).is(‘:checked’) ){ $(“#e1 > option”).prop(“selected”,”selected”);// Select All Options $(“#e1”).trigger(“change”);// Trigger change to select 2 }else{ $(“#e1 > option”).removeAttr(“selected”); $(“#e1”).trigger(“change”);// Trigger change to select 2 } }); $(“#button”).click(function(){ alert($(“#e1″).val()); }); <select multiple id=”e1″ style=”width:300px”> <option value=”AL”>Alabama</option> <option value=”Am”>Amalapuram</option> <option value=”An”>Anakapalli</option> <option value=”Ak”>Akkayapalem</option> <option value=”WY”>Wyoming</option> </select> <input type=”checkbox” id=”checkbox” >Select All … Read more