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

2 posts, 1 answers
  1. Ian
    Ian avatar
    73 posts
    Member since:
    Jun 2013

    Posted 16 Jul 2013 Link to this post

    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
  2. Answer
    Dimo avatar
    8478 posts

    Posted 17 Jul 2013 Link to this post

    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.

    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
Back to Top