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

Disable specific tokens

4 Answers 83 Views
AutoCompleteBox
This is a migrated thread and some comments may be shown as answers.
Mickael
Top achievements
Rank 1
Mickael asked on 31 Oct 2014, 02:09 AM
Hi,

Is it possible to disable specific tokens in an AutoCompleteBox?

I found that tokens have a 'isDisabled' property, but changing it does nothing as far as I can tell.

This is my code so far

function AddNewEntry(pText, pDisabled) {
    var autoCompleteBox = $find("<%=RdtCmpltBx_Data.ClientID %>");
    var entry = new Telerik.Web.UI.AutoCompleteBoxEntry();
    entry.set_text(pText);
    autoCompleteBox.get_entries().add(entry);
                         
    if (pDisabled == true) {
        var token = entry.get_token();
        token.isDisabled = true;
    }
}

4 Answers, 1 is accepted

Sort by
0
Mickael
Top achievements
Rank 1
answered on 03 Nov 2014, 02:21 PM
I could use some help on this.
0
Nencho
Telerik team
answered on 04 Nov 2014, 01:52 PM
Hello Michael,

I am afraid that there is no such property of the tokens of the RadAutoCompleteBox. Could you share the source, where you had observed its usage? However, once being able to access the token element, you could apply custom styles and implementation on the DomElement, in order to achieve the descried functionality.

Regards,
Nencho
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.

 
0
Mickael
Top achievements
Rank 1
answered on 04 Nov 2014, 02:13 PM
Hi Nencho,

I simply added 'debugger;' to my javascript and checked into the property of the token.

In Visual Studio, when I mouse over the javascript variable for the token, I can see: '_token'
When I expand it I can see a 'isDisabled' property

I will see to change the style of the token instead.

Thanks
0
Mickael
Top achievements
Rank 1
answered on 04 Nov 2014, 02:14 PM
when I debugger the javascript code, for the token I can see a '_token' property.
if I expand it, there is a 'isDisabled' property set to false.

Anyway, I will most probably just change the style of that entry instead.

Thanks
Tags
AutoCompleteBox
Asked by
Mickael
Top achievements
Rank 1
Answers by
Mickael
Top achievements
Rank 1
Nencho
Telerik team
Share this question
or