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

Disable autocomplete selection for inactive record

1 Answer 21 Views
AutoCompleteBox
This is a migrated thread and some comments may be shown as answers.
Zakir
Top achievements
Rank 1
Zakir asked on 17 Sep 2014, 02:36 PM
Hi,

Is it possible to disable auto complete selection event for inactive records only and on selection of inactive record, auto complete popup should not close?

Thank You
Zakir

1 Answer, 1 is accepted

Sort by
0
Bozhidar
Telerik team
answered on 19 Sep 2014, 07:07 AM
Hello Zakir,

Thank you for contacting us.

The desired functionality can be achieved only in token mode, using the OnClientDropDownClosing and OnClientEntryAdding events. Here's an example:
function OnClientEntryAdding(sender, args) {
    if (args.get_entry().get_text() === "Aniseed Syrup") {
        args.set_cancel(true);
    }
}
 
function OnClientDropDownClosing(sender, args) {
    if (sender._dropDown.get_activeItem().get_text() === "Aniseed Syrup") {
        args.set_cancel(true);
    }
}

Hope this was helfpul.

Regards,
Bozhidar
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
Tags
AutoCompleteBox
Asked by
Zakir
Top achievements
Rank 1
Answers by
Bozhidar
Telerik team
Share this question
or