Cascading Select in Javascrip and Telerik RadFormDecorator

2 posts, 0 answers
  1. ABC
    ABC avatar
    20 posts
    Member since:
    Mar 2012

    Posted 05 Sep 2013 Link to this post

    I am trying very hard to make my cascading select decorate using telerik form decorator. Here is my js,


    var attributes = s.attributes;
     for (var i = 0, iLen = attributes.length; i < iLen ; i++) {
         $elem.append('<option ' + (selectedValue === attributes[i].id ? 'selected ' : '') + 'value="' + attributes[i].id + '">' + attributes[i].name + '</option>');
     }


    after this I am calling,


    formDecorator.decorate($elem[0], false);

    It only works first time when the parent select changed(in a cascading select). But after this nothing works. I have tried,


    formDecorator.decorate();

    and

    formDecorator.updateSelect($elem[0]);

    Is there is any way to make it work?

  2. Slav
    Admin
    Slav avatar
    1355 posts

    Posted 09 Sep 2013 Link to this post

    Hi,

    Please note that you need to pass the parent element of the select as a parameter of the decorate function in order to style it. You can find an example in this help article.

    Also, I would suggest checking whether the select HTML element is added on the page and ensuring that the client-side object of the form decorator is initialized (the event Sys.Application.load can be used for this purpose).

    Regards,
    Slav
    Telerik
    Explore the entire set of ASP.NET AJAX controls we offer here and browse the myriad online demos to learn more about the components and the features they incorporate.
  3. UI for ASP.NET Ajax is Ready for VS 2017
Back to Top