Hi All,
I have a requirement where i need to display hiererchical grid which has child data and will be displayed on click of the parent grid.
Now, i Don't want to show the expansion panel for the rows which donot have child in it.
To indicate that, i have a flag with true and false to identify whether there is data in child in parent grid.
Can anyone help on this with example, on how can we do this .
Little help would be very much helpful.
Thanks,
Subham
Hi Monika,
please consider my example.
Hello Subham,
I have prepared sample, demonstrating how to hide the expand icon for rows that don’t have children. In the method show, I set a variable hasData to true or false, depending on the row’s children. There you can use your boolean variable. Then I have used a template for the collapsedIndicator and the template looks like this:
<ng-template igxRowCollapsedIndicator let-row>
<igx-icon fontSet="material" [style.visibility]='show(row) ? "visible" : "hidden"'>keyboard_arrow_right</igx-icon>
</ng-template>
This way you would see the icon only if the child grid is not empty.
Please let me know if you need additional information regarding this matter.
Regards,
Monika Kirkova,
Infragistics
The property u mentioned is to go through the hierarchy to set this value(hasChildProperty), but i already have a flag in parent element to indicate whether there is a child for a row or not, so can i get the solution in that terms, to just disable the expansion based on that.
Hope, u understood, what i meant, it would be helpful if i get an example.
After investigating your requirement further, I determined that your request could be achieved by using the hasChildrenKey property.
More information could be found in the following forum post, where a working sample is provided and explained.
Regards, Monika Kirkova, Infragistics