Pending Review
Last Updated: 28 Sep 2018 14:55 by ADMIN
Balazs
Created on: 27 Sep 2018 16:06
Category: Grid
Type: Feature Request
1
make groupIndex available inside the groupHeaderTemplateDirective (and footer)
when expanding a group, inside the expand event (function) we do have access to the groupIndex.

but groupIndex is not available inside the groupHeader(Footer)Template itself.

we need that groupIndex, so we can get the parent items (groups) to the group that is expanded.
1 comment
Balazs
Posted on: 28 Sep 2018 14:54
From SUPPORT: We already added the desired functionality. The groupHeaderTemplateDirective will export the groupIndex as well. Indeed, it will take some time for the change to take effect as some internal checks need to be passed before we can release the new version.

You can follow the changelog article of the grid for latest versions updates:
https://www.telerik.com/kendo-angular-ui-develop/components/grid/changelog/


I already had a way to find the item in the hierarchy via the available dataItem in the header:

    private getNodePathArrayToGroupViaGroupDataItem(gridItems: any[], groupDataItem: any, parentPath: Array<{ field: string, value: any }> = []): Array<{ field: string, value: any }> {

        let currentNodeItems = gridItems;

        for (let nodeItem of currentNodeItems) {
            if (this.isAggregate(nodeItem)) {
                let thisPath = parentPath.concat({field: nodeItem.field, value: nodeItem.value});

                let itemFound = nodeItem === groupDataItem;
                if (itemFound)
                    return thisPath;

                let innerResult = this.getNodePathArrayToGroupViaGroupDataItem(nodeItem.items, groupDataItem, thisPath);
                if (innerResult)
                    return innerResult;
            }
        }

        return null;
    }