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

Javascript in Angular Partial

1 Answer 70 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Christian
Top achievements
Rank 1
Christian asked on 05 Jan 2015, 05:53 PM
Hi there,

I am just transforming my pure ASP.net 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!

1 Answer, 1 is accepted

Sort by
0
Alexander Valchev
Telerik team
answered on 07 Jan 2015, 03:45 PM
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.

Regards,
Alexander Valchev
Telerik
 

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.

 
Tags
Grid
Asked by
Christian
Top achievements
Rank 1
Answers by
Alexander Valchev
Telerik team
Share this question
or