This is a migrated thread and some comments may be shown as answers.

RadCombo select

0 Answers 78 Views
ComboBox
This is a migrated thread and some comments may be shown as answers.
charles
Top achievements
Rank 1
charles asked on 30 Mar 2012, 04:44 PM
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();            
}                        
}
}

No answers yet. Maybe you can help?

Tags
ComboBox
Asked by
charles
Top achievements
Rank 1
Share this question
or