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

Grid hierarchical data

4 Answers 421 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Kai
Top achievements
Rank 1
Kai asked on 16 Aug 2012, 02:48 PM
I'm trying to do use the hierarchical aspect of the Kendo Grid. What I'm unable to find out is if when I make the Detail template do the children need to be already loaded from my repository? I thought since there was a Data-source it would make the call to the server get the children when it was loading. The Template grid has is null and there are no query strings (as followed by the example) Can I get some clarification on this please?

4 Answers, 1 is accepted

Sort by
0
Alexander Valchev
Telerik team
answered on 21 Aug 2012, 11:13 AM
Hello Kai,

I am not sure if I understood your questions correctly, but by design the detail template will render on demand. When the user expands a master grid row for a first time, the detail template will be executed and after that detailInit event will fire. In case there is a child grid it should perform an Ajax request to load its data. You can observe the behaviour in hierarchy demos:

Regards,
Alexander Valchev
the Telerik team
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
0
Jun
Top achievements
Rank 1
answered on 11 Sep 2012, 01:29 PM
I have also been trying to make this work but for some reasons, the template's datasource read action is not firing to retrieve the data. What seems to be the cause of this? But the example you have provided worked! Am I missing something?

Thanks,

Jun

Nevermind, I found the issue. I have a white space character on the template's grid client id.
0
George
Top achievements
Rank 1
answered on 27 Jun 2013, 09:01 AM
Hi,

I'm looking to build a multi level kendo ui grid, where the client template can somehow call back on itself to generate the next level down. At the moment I can obviously just have clienttemplate1 refer to clienttemplate2 etc, but this requires hard coding of the level depth in my Razor view. What would be cool would be to have some kind of event handler (DetailExpand I guess) which generates the next level down, passing the level information through to the controller through a binding action. The detail arrow would be deactivated when the lowest level of aggregation is achieved (i.e. when there are no longer any available sub nodes). Like this, the amount of code could be significantly reduced, and the hierarchy depth deduced programmatically. Is there a workaround for this?

Thanks,
George  
0
Alexander Valchev
Telerik team
answered on 02 Jul 2013, 08:19 AM
Hello George,

If I understood correctly, you are looking for an event which fires when detail row is initialized. DetailInit event will fire when detail table row is build.
In case you would like to force detail row initialization, you may expand the corresponding master row through the API:

Regards,
Alexander Valchev
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
Kai
Top achievements
Rank 1
Answers by
Alexander Valchev
Telerik team
Jun
Top achievements
Rank 1
George
Top achievements
Rank 1
Share this question
or