Reputation: 102803
I have a routine to delete items from an ExtJS combobox when the user hits control-delete. Currently this routine deletes the selected item, but I want to instead delete the highlighted item. This combobox is being used for an autocompleted value and I need users to be able to delete values from their history. When they start typing a list of options comes up in the combobox and they are pointing to the item they want to delete and hitting my keystroke, but instead it deletes the currently selected value, which is not what they want.
How do I get the value that is being highlighted on the combobox?
Upvotes: 0
Views: 447
Reputation: 102803
The following seems to work:
var list = combo.getPicker().getNavigationModel().view
var highlightedItem = list.highlightedItem
var index = list.indexOf(highlightedItem)
var highlightedRecord = combo.store.data.items[index]
Upvotes: 1