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

When are items inside a rendered control available to jQuery? (MVC)

1 Answer 39 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Ian
Top achievements
Rank 2
Ian asked on 16 Jul 2013, 11:02 PM
Life Cycle question

I have a standard grid on a page. The grid has templates that generate some Html.

I try to modify the html the grid generated with jQuery in the Document Ready function, but the elements are not there when I attempt the blow javascript. I am guessing I am trying to early in the life cycle? If so, how do I modify internal html elements using jQuery? Note that if I manually run the script in FF's FireBug after the page is all ready, it works fine.
 
$(function () {
           $("a.subLinkMadeInAGrid").click(function () {
               //Do something with this item
           });

1 Answer, 1 is accepted

Sort by
0
Accepted
Dimo
Telerik team
answered on 17 Jul 2013, 12:24 PM
Hello Ian,

When using client templates, you should subscribe to the Grid's dataBound event.

What you have tried will work with server templates only.

Regards,
Dimo
Telerik
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
Tags
General Discussions
Asked by
Ian
Top achievements
Rank 2
Answers by
Dimo
Telerik team
Share this question
or