Does Kendo support binding the onload event to a viewModel

3 posts, 1 answers
  1. David
    David avatar
    3 posts
    Member since:
    Oct 2015

    Posted 29 Jan Link to this post

     I would like to run code in the viewModel after the page has loaded/rendered.

    e.g.  <div id="terminalForm" data-bind="events: {onload: addValidator}" >

    My problem I'm trying to solve is attaching a validator , which can only be done after the template has been rendered. 

    $("#terminalForm").kendoValidator().data("kendoValidator");

     

     I'm building a spa app, and not sure it it's preventing the onload event firing or if the kendo bind doesn't support it.

     any help appreciated.

    cheers,

     

     

  2. Answer
    Rosen
    Admin
    Rosen avatar
    3234 posts

    Posted 02 Feb Link to this post

    Hello David,

     

    As you may know div elements does not have onload event. However, in order to attached the Validator widget you could decorate the element with data-role="validator" attribute.

     

    Regards,
    Rosen
    Telerik
     
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
     
  3. Kendo UI is VS 2017 Ready
  4. David
    David avatar
    3 posts
    Member since:
    Oct 2015

    Posted 02 Feb in reply to Rosen Link to this post

    Thank you Rosen,

     :-)

    The attribute is perfect.

Back to Top