Dear Support,
Are there any property or method that could force the combobox to select the last selected item when it is empty?
Thanks.
Printable View
Dear Support,
Are there any property or method that could force the combobox to select the last selected item when it is empty?
Thanks.
Hello @kwcitadmin!
You can use the change listener to revert to last selection if value is empty! But notice the change event will trigger as soon as the text matches one or none value. Another good pick is to revert to last selected value on the blur event (when the combo box loses focus). So the user can type whatever he wants and the selected value is only enforced once the user moves on to next field.
There's also the keypress event but it probably wouldn't trigger if the user clicks the combo field's 'clear' button and special treatment for this case might be taken.
Hope this helps!
Thanks fabricio.murta,
I have add the following blur handler in the combobox, you could close the case.
Thanks.
Code:var blurHandler = function(cbx){
if(cbx.selection == null)
cbx.select(cbx.lastSelectedRecords[0]);
};
Hello @kwcitadmin!
Glad you could find a solution that fits your needs! Thanks for sharing!