I am trying to find a solution when user is trying to search for a item and cannot be found. it will return to first item.
When the first item is selected, the cursor is at the end of selected text. Is there any way that when the user start search for next item, it will just clear the selected text. maybe there is a way to highlight the selected text so it will get clear when user start typing?
thanks
function RadComboBlur(source, args) {
var oval = source.get_text();
if (oval != source.get_selectedItem().get_text()) {
var digit = source.get_items().getItem(0).get_value().length;
var val = $.strPad(oval, digit);
var item = source.findItemByValue(val);
if (item) {
item.select();
} else {
if (oval == "") {
alert("Value cannot be empty. Default value is selected instead.");
}else{
alert("Input value does not exists. Default value is selected instead.");
}
var item = source.get_items().getItem(0);
item.select();
}
}
}
When the first item is selected, the cursor is at the end of selected text. Is there any way that when the user start search for next item, it will just clear the selected text. maybe there is a way to highlight the selected text so it will get clear when user start typing?
thanks
function RadComboBlur(source, args) {
var oval = source.get_text();
if (oval != source.get_selectedItem().get_text()) {
var digit = source.get_items().getItem(0).get_value().length;
var val = $.strPad(oval, digit);
var item = source.findItemByValue(val);
if (item) {
item.select();
} else {
if (oval == "") {
alert("Value cannot be empty. Default value is selected instead.");
}else{
alert("Input value does not exists. Default value is selected instead.");
}
var item = source.get_items().getItem(0);
item.select();
}
}
}