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

Cascading Select in Javascrip and Telerik RadFormDecorator

1 Answer 18 Views
FormDecorator
This is a migrated thread and some comments may be shown as answers.
ABC
Top achievements
Rank 1
ABC asked on 05 Sep 2013, 07:13 AM

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?

1 Answer, 1 is accepted

Sort by
0
Slav
Telerik team
answered on 09 Sep 2013, 02:42 PM
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.
Tags
FormDecorator
Asked by
ABC
Top achievements
Rank 1
Answers by
Slav
Telerik team
Share this question
or