Ovi
Ovi

Reputation: 2559

Kendo for angular grid with grouping manipulate data within group

I am using a kendo for angular grid with grouping, this grid, is it possible to take action only on records within a specific group?

For example, in the group header I have a button and every row has a check box, when the user clicks the button I need to get only the rows with in that group.

Or select all rows in one group ?

Upvotes: 0

Views: 2828

Answers (1)

topalkata
topalkata

Reputation: 2098

In the Grid Header Template we have access to the group property that in turns contains all data items for the respective group under its items property.

You can pass them to the custom button click handler and proceed accordingly:

<kendo-grid-column field="Category.CategoryName" title="Category">
            <ng-template kendoGridGroupHeaderTemplate let-group let-field="field" let-value="value">
            <strong>{{field}}</strong>: {{value}} <button class="k-button" (click)="onClick(group)">CLICK</button>
          </ng-template>
        </kendo-grid-column>

EXAMPLE

For example selecting all items from a group:

REFERENCE ON SELECTION

ENHANCED EXAMPLE

Upvotes: 1

Related Questions