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

AngularJS Detail Grid with Dynamic Columns

5 Answers 498 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Chuck
Top achievements
Rank 1
Chuck asked on 18 Feb 2015, 03:43 PM
Good morning,

I'm looking for a suggestion of how to approach the following situation:

  - Editable AngularJS Grid (with dynamically created columns based on server response...use the k-ng-delay to delay until columns built) (this works fine)
  - Editable Detail Grid with dynamically created columns based on a server response

Previously we were using the standard template approach based on the detailInit and detailTemplate as specified in this demo: http://demos.telerik.com/kendo-ui/grid/detailtemplate. Our template had angular directives to disable buttons, etc. and we would not attach the detail grid until the columns were built based on data from the server.

All this worked fine until upgrading from V2014.2.1008 to V2014.3.1411. After this upgrade, when an edit was made to the detail grid data, the angular directives no longer got fired unless we force a $apply based on some other event or we click to edit a field in the master row.

We started adjusting our detail grid to follow the more-angular approach as specified here, http://demos.telerik.com/kendo-ui/grid/angular, but not sure how to delay binding as the k-ng-delay and k-rebind don't make sense in this context. 

Any suggestions on how to follow this approach?

Thanks,
Chuck









5 Answers, 1 is accepted

Sort by
0
Chuck
Top achievements
Rank 1
answered on 18 Feb 2015, 08:34 PM
I setup a dojo of a simplified version of what we are doing. If you edit the detail grid in any of the Q3 versions of Kendo UI, the digest does not get fired, however, if you switch to any of the Q2 version, the digest gets fired after an update in the detail grid.

http://dojo.telerik.com/@webpursuits/eSeSu/10

Thanks,
Chuck
0
Petyo
Telerik team
answered on 20 Feb 2015, 09:00 AM
Hi Chuck,

this is a change we introduced based on customer feedback. In the Q2 version, widgets in an AngularJS app interacted with the scope (and followed various other AngularJS specific conventions) even when they weren't instantiated as AngularJS directives. This effectively broke customers who used custom directives to instantiate the Kendo UI widgets.

With that change, the detail grid which previously interacted with the scope no longer does it. You may restore that behavior if you instantiate it with a directive in the template instead.  

Regards,
Petyo
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
0
Chuck
Top achievements
Rank 1
answered on 23 Feb 2015, 05:39 PM
Thank you for your reply Petyo. What would that look like then? Do you have an example that allows for dynamically building columns? Secondly, does that explain why the kendo-auto-complete does not work as well within my detail grid?

Chuck
0
Petyo
Telerik team
answered on 25 Feb 2015, 09:43 AM
Hello Chuck,

I may be missing something, but the dojo you does not feature an autocomplete. Is there any chance to update the example?

I also updated your example to initialize the detail grid from a directive - perhaps this would help you. 

Regards,
Petyo
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
0
Petyo
Telerik team
answered on 25 Feb 2015, 11:09 AM
Hello,

After some further investigation, I also managed to get this approach working. It seems cleaner.

Regards,
Petyo
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
Chuck
Top achievements
Rank 1
Answers by
Chuck
Top achievements
Rank 1
Petyo
Telerik team
Share this question
or