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

Grid render/re-render ng-if (angular)

4 Answers 409 Views
Grid
This is a migrated thread and some comments may be shown as answers.
JSON
Top achievements
Rank 1
JSON asked on 09 Sep 2014, 08:28 PM
So I have a grid I need to render, and this rendering is dependent on data being loaded. Using a Restangular service to find the data, and on the success .then(), the grid is rendered with data. Normally in angular, this would be handled by an ng-repeat. I don't know how this is handled in the kendo grid angular implementation.

At any rate, in the template, the grid is surrounded by a tag with an ng-if="dataSourceExists". I can render a regular table using ng-repeat, but when I try to do this with the kendo grid I get this:

"TypeError: Cannot read property 'replace' of undefined"

Since the documentation surrounding your implementation of angular and how data gets bound is sparse, I am having difficulty solving this problem. Any help would be appreciated.

4 Answers, 1 is accepted

Sort by
0
JSON
Top achievements
Rank 1
answered on 09 Sep 2014, 09:29 PM
So I discovered that by having the kendo template embedded in the ng-if command causes this error as it's not considered "in the DOM" at the time and the jQuery can't find it. Still can't get data to render.
0
Alex Gyoshev
Telerik team
answered on 10 Sep 2014, 09:31 AM
Hello Joe,

I assume that even when the widget is in the ng-if directive, it tries to initialize. You may need to use ng-k-delay directive in order to suppress or delay the widget initialization. If that does not help, please supply a Dojo snippet that shows the problem.

Regards,
Alex Gyoshev
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
0
JSON
Top achievements
Rank 1
answered on 10 Sep 2014, 07:06 PM
I tried the delay and the result was that it rendered with no data. Quite honestly, your documentation when it comes to Angular is scattered and confusing when it comes to the grid.
0
Alex Gyoshev
Telerik team
answered on 11 Sep 2014, 08:00 AM
Hello Joe,

Our documentation for AngularJS is listed here. It contains information how to use the widgets in the AngularJS application -- and it is relevant to all widgets, including the grid. Apart from that, every widget has an AngularJS demo.

If you need specific help with your application, send a runnable sample that shows the problem.

Regards,
Alex Gyoshev
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
Tags
Grid
Asked by
JSON
Top achievements
Rank 1
Answers by
JSON
Top achievements
Rank 1
Alex Gyoshev
Telerik team
Share this question
or