EasyUI Forum

General Category => General Discussion => Topic started by: donlaur on October 26, 2015, 09:43:26 AM



Title: Combobox that is not Editable, but can be selected.
Post by: donlaur on October 26, 2015, 09:43:26 AM
I want to make the combobox so that you can use as a dropbox and select an item, but the issue is that this combobox allows you to enter in your own field and option and save that.  I was to restrict options and I want people to select Illinois, not enter in IL in the combobox.  Editable false doesn't work, just makes where I can not select the dropdown.


Title: Re: Combobox that is not Editable, but can be selected.
Post by: jarry on October 26, 2015, 03:22:20 PM
The editable property defines if the user can type text directly into the field. If you set it to false, you are not allowed to enter anything on the textbox but you can select options from the drop-down items.


Title: Re: Combobox that is not Editable, but can be selected.
Post by: korenanzo on December 16, 2015, 02:26:57 AM
The editable property defines if the user can type text directly into the field. If you set it to false, you are not allowed to enter anything on the textbox but you can select options from the drop-down items.

in this condition (editable:false) the options panel shows itself automatically when the user clicks into the textfield.


 Is it possible to switch it off, so that the panel is showed only if the user clicks the arrow?

thanks, RIc


Title: Re: Combobox that is not Editable, but can be selected.
Post by: jarry on December 17, 2015, 12:09:35 AM
To disable the clicking behavior on the inputbox, please try this code:
Code:
$('#cc').combobox({
    editable: false,
    inputEvents: $.extend({}, $.fn.combobox.defaults.inputEvents, {
    click: function(){}
    })
})


Title: Re: Combobox that is not Editable, but can be selected.
Post by: korenanzo on December 17, 2015, 12:48:35 AM
thanks,
RIc
 :)