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

Grid in Angular 2, how to use methods?

2 Answers 508 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Tobias
Top achievements
Rank 1
Tobias asked on 18 Aug 2017, 01:26 PM

How do I, for example, programatically call the method addRow listed here? 

http://www.telerik.com/kendo-angular-ui/components/grid/api/GridComponent/#toc-methods

I can't find it explained anywhere for any of the components...

2 Answers, 1 is accepted

Sort by
0
Accepted
Dimiter Topalov
Telerik team
answered on 22 Aug 2017, 07:03 AM
Hi Tobias,

To use the Kendo UI components methods, you will need an instance of the respective component (e.g. Grid). There are various possible approaches (all are common, non Kendo UI-specific, Angular ones) to obtain an instance of the component, perhaps the most widely used one being via ViewChild:

http://plnkr.co/edit/JqCxR2ZXAfRaZNDKb9Hw?p=preview

Here is a runnable online demo from our documentation, also demonstrating the described approach for calling the expandRow() method on a hierarchical Grid:

http://www.telerik.com/kendo-angular-ui/components/grid/hierarchy/

I hope this helps.

Regards,
Dimiter Topalov
Progress Telerik
Try our brand new, jQuery-free Angular 2 components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
0
Tobias
Top achievements
Rank 1
answered on 22 Aug 2017, 08:40 AM
Thanks! Just what I was looking for.
Tags
Grid
Asked by
Tobias
Top achievements
Rank 1
Answers by
Dimiter Topalov
Telerik team
Tobias
Top achievements
Rank 1
Share this question
or