Disable specific tokens

5 posts, 0 answers
  1. Mickael
    Mickael avatar
    57 posts
    Member since:
    Oct 2014

    Posted 30 Oct 2014 Link to this post

    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;
        }
    }

  2. Mickael
    Mickael avatar
    57 posts
    Member since:
    Oct 2014

    Posted 03 Nov 2014 in reply to Mickael Link to this post

    I could use some help on this.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Nencho
    Admin
    Nencho avatar
    1457 posts

    Posted 04 Nov 2014 Link to this post

    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.

     
  5. Mickael
    Mickael avatar
    57 posts
    Member since:
    Oct 2014

    Posted 04 Nov 2014 in reply to Nencho Link to this post

    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
  6. Mickael
    Mickael avatar
    57 posts
    Member since:
    Oct 2014

    Posted 04 Nov 2014 in reply to Nencho Link to this post

    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
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017