Question

Actually, I'm trying to use a combo-box in Ext.Net to select a value from its selecting list. This combo-box is editable and user can type any value he want. On selecting list, I want to prevent user from selecting the highlighted item by pressing Enter key and let him just select it by mouse click. for this, i tried to use an listener on bound list "ItemKeyDown" but it did nothing. Other events related to mouse par example, working fine but all events related to key are not working. I don't know if i have missed something in configurations or what. Anyone can give me any advise to make theses listeners work? Thanks in advance,

var combo = Html.X().ComboBox().DisplayField(mark).ValueField(type).Editable(true)
                    .ID(combo_id).EnableKeyEvents(true).AutoSelect(false).SelectOnFocus(true)
                    .QueryMode(DataLoadMode.Local).ValidateOnBlur(false).ValidateOnChange(false)
                    .ListcConfig(Html.X().BoundList()
                               .Listeners(l => l.ItemKeyDown.Handler = "console.log('ItemKeyDown');")); /// ItemKeyDown not displayed in console.
Was it helpful?

Solution

I post the solution i got from Ext.Net support team so if someone need it in future:

@(Html.X().ComboBox()
.Listeners(events => {
    events.Expand.Handler = @"this.listKeyNav.map.removeBinding({
                                  key: Ext.EventObject.ENTER
                              });";
    events.Expand.Delay = 1;
    events.Expand.Single = true;
})

)

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top