Details row and Hierarchical binding

Hi,
I've read in the documentation about Hierarchicla binding that having a nested grid inside the main grid and expandable details in rows, is not possible, is that true?.
The grid scheme I need to implements is as it follows:
Image
So I had a grid inside any of the rows, when expand icon is clicked, and also some expanded inforamtion whne click on the icons of the icon columns,
Is something I can do to get my goal? I'm being checking the grouping feature as well, but for the look and functioanlity of my prototype, it seems like it is not what I'm looking for.
Thank you

5 Replies

MS Manivel Sellamuthu Syncfusion Team May 12, 2020 05:50 AM UTC

Hi Juan, 

Greetings from Syncfusion support. 

EJ 2 Grid supports n level of child grids. Hierarchical binding is not supported when DetailTemplate is enabled. Due some reasons, the image is not accessible at our end. So we suggest you to re-attach the image for our better understanding of your implementation. If possible, please share the implemented Grid code. 

Also We suggest you to take a glance at our Hierarchical binding demos and documentation links. 



Regards, 
Manivel 



JU Juan May 12, 2020 06:11 AM UTC

Hi,
I attached the image as a 7z file.
Thank you!

Attachment: grid_scheme_b85e0587.7z


MS Manivel Sellamuthu Syncfusion Team May 13, 2020 01:35 PM UTC

Hi Juan, 

Thanks for your update. 

From your attached image of the layout we can get your requirements. From that query we can confirm that we can achieve your layout in Grid applying by the below features. 

  1. Selector column – which can be achieved using checkbox selection feature of the Grid
 
  1. Regular columns and icons column and actions columns can be achieved respective by defining columns, template columns and command columns.
 
  1. Row Groups and rowGroup details can be achieved using detail template feature of the Grid.
 
  1. Hide expand icons for rows that have not details.
 
Based on your confirmation , we will prepare the sample based on the layout and update the sample. 

Regards, 
Manivel 



JU Juan May 14, 2020 07:43 AM UTC

Hi,
I've read your answer. It seems everything is okey, but the point 3 is not totally clear, that was my real concern when I open this ticket, rest of things are working perfectly.
My problem here is that I need a child grid and at  the same time, a row details for the rows of the main grid. As you say I can get that filling up the detailRowTemplate of the main grid with someting like this:
<ng-template #detailTemplate let-data>
<div [hidden]="!data.isAttachmentDetailsVisible">Attachment details</div>
<div [hidden]="!data.isCommentDetailsVisible">Comment details</div>
<div [hidden]="!data.isLabelDetailsVisible">Label details</div>
<div [hidden]="!data.isAccountingDetailsVisible">Accounting details</div>
<ejs-grid #childGrid
[dataSource]="data.items">
<ng-template #detailTemplate let-data>
<div [hidden]="!data.isAttachmentDetailsVisible">Attachment for {{data.name}}</div>
<div [hidden]="!data.isCommentDetailsVisible">Comment nested details</div>
<div [hidden]="!data.isLabelDetailsVisible">Label nested details</div>
<div [hidden]="!data.isAccountingDetailsVisible">Accounting nested details</div>
</ng-template>
<e-columns>
<e-column field="id" [visible]="false"></e-column>
<e-column field="name" headerText="Document"></e-column>
<e-column field="state" headerText="Document"></e-column>
<e-column field="createdDate" headerText="Due date"></e-column>
<e-column field="amount" headerText="Amount"></e-column>
<e-column field="attachmentsNumber" headerTemplate="#attachment">
<ng-template #template let-data>
<ib-icon [icon]="'info'" (click)="showNestedDetails($event, data, 'isAttachmentDetailsVisible')"></ib-icon>
</ng-template>
</e-column>
<e-column field="comments" headerTemplate="#comment">
<ng-template #template let-data>
<ib-icon [icon]="'people'" (click)="showNestedDetails($event, data, 'isCommentDetailsVisible')"></ib-icon>
</ng-template>
</e-column>
<e-column field="labels" headerTemplate="#label">
<ng-template #template let-data>
<ib-icon [icon]="'plus'" (click)="showNestedDetails($event, data, 'isLabelDetailsVisible')"></ib-icon>
</ng-template>
</e-column>
<e-column field="accountingList" headerTemplate="#accounting">
<ng-template #template let-data>
<ib-icon [icon]="'lens'" (click)="showNestedDetails($event, data, 'isAccountingDetailsVisible')"></ib-icon>
</ng-template>
</e-column>
</e-columns>
</ejs-grid>
</ng-template>

But the problem is that I lose the control of the child grid throught the property childGrid of the parent grid. I mean,
for example I could do something like this (this.grid is the main GridComponent):
this.grid.childGrid.columns // getting access to the childColumn
if I were defined the childGrid by this way:
<ejs-grid #gridRef
[dataSource]='data'
[allowSorting]="true"
[childGrid]="childGrid"
I could have access all the properties, methods,.....
is there a way that defining the nested ejs-grid as this:
<ejs-grid #gridRef
[dataSource]='data'
[allowSorting]="true"
[childGrid]="childGrid"
[selectionSettings]="selectionOptions"
(created)="created($event)"
(dataBound)="dataBound($event)"
[enableVirtualization]=true
height=900>
<ng-template #detailTemplate let-data>
<div [hidden]="!data.isAttachmentDetailsVisible">Attachment details</div>
<div [hidden]="!data.isCommentDetailsVisible">Comment details</div>
<div [hidden]="!data.isLabelDetailsVisible">Label details</div>
<div [hidden]="!data.isAccountingDetailsVisible">Accounting details</div>
<ejs-grid #childGrid
I could set the internal ejs-grid as child of the outter ejs-grid?





MS Manivel Sellamuthu Syncfusion Team May 15, 2020 01:10 PM UTC

Hi Juan 

Thanks for your update. 

From your shared code example we could see that you have enabled virtualization for the Grid. We would like to inform you that  
Virtual scrolling is not compatible with detail template and hierarchy features. The limitations can be found in the below documentation link. 


Please let us know, if you need further assistance. 

Regards, 
Manivel 


Loader.
Up arrow icon