bootstrap-combobox icon indicating copy to clipboard operation
bootstrap-combobox copied to clipboard

Set default value

Open smurfkungen opened this issue 9 years ago • 3 comments

How can i set default value of the combo box.

I am using asp and want to set the comboxi according the a hidden field $('.ComboBox').val(document.getElementById('<%#Me.hdnHostName.ClientID%>').value);

But I am unable to refresh the combo based on this value.

I have tried $('.ComboBox').refresh; to no avail

Thank you for some help

smurfkungen avatar Sep 25 '15 14:09 smurfkungen

I would really like to know how to do this as well.

Nicks182 avatar Oct 07 '15 05:10 Nicks182

Please try: $(".ComboBox").data('combobox').refresh();

phoeson avatar Apr 15 '16 10:04 phoeson

if($("option[value='"+selectVal+"']",this.ui.select).length > 0){
    this.ui.select.val(selectVal);
    this.ui.select.data("combobox").refresh();
    this.ui.select.data("combobox").triggerChange();
}

Thanks @KevinPan.

I had something listening for selection and calling triggerChange() triggered the event for me. this.ui.select is my jQuery element for my select element. If statement checks the option exists.

markdon avatar Sep 01 '16 23:09 markdon