Javascript in Angular Partial

2 posts, 0 answers
  1. Christian
    Christian avatar
    38 posts
    Member since:
    Jul 2014

    Posted 05 Jan 2015 Link to this post

    Hi there,

    I am just transforming my pure Application into an angular SPA.

    The kendo widgets are defined with MVC wrappers and I use small javascripts i.e for 
    --> .Events(e => e.DataBound("onDataBound")) or 
    --> .Read(read => read.Action("Index", "Contact").Data("updateGrid")

    However the scripts do not work when angular loads the partial. (updateGrid is not defined)

    What is the best approach to reference a javascript from within a mvc defined Grid? Can I hand in an angular controller method somehow?

    Thank you very much!
  2. Alexander Valchev
    Alexander Valchev avatar
    2895 posts

    Posted 07 Jan 2015 Link to this post

    Hello Christian,

    You may define the event handlers directly in the AngularJS controller. Please see this example and pay attention to the dataBound event:
    The updateGrid function should be transformed - you may use either the `data` property of the Ajax request or parameterMap of the dataSource.transport.
    I hope this information will help.

    Alexander Valchev

    Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

Back to Top