Hello!
I have a grid filter is specified as "menu" ([filterable]="'menu'")
Some the grid columns are created dynamically like this:
<kendo-grid-column *ngFor="let c of myColumnsObjects"
field="{{ c.name }}"
title="{{ c.title }}"
>
<ng-template
kendoGridFilterMenuTemplate
let-column="column"
let-filter="filter"
let-filterService="filterService"
>
<app-mycolumn-filter
[field]="column.field"
[filterService]="filterService"
[currentFilter]="filter"
[distinctData1]="getDistinctData1(column.field)"
[distinctData2]="getDistinctData2(column.field)"
[distinctData3]="getDistinctData3(column.field)"
></app-mycolumn-filter>
</ng-template>
<ng-template
kendoGridCellTemplate
let-dataItem >
<ng-container *ngIf="getObjectByColumnName(c.name, dataItem) as myItem">
<div class="{{getClassByObject(myItem)}}">
<div>{{myItem.dataOfField1}}</div>
<div>{{myItem.dataOfField2}}</div>
<div>{{myItem.dataOfField3}}</div>
</div>
</ng-container>
</ng-template>
</kendo-grid-column>
Where
myColumnsObjects is
interface IMyDynamicallyColumn {
name: string;
title: string;
}
dataItems is array of
interface IMyData {
id: number;
name: string;
somecomlexobject: any;
....
myItems: IMyItem[];
otheItems: IOtherItem[];
}
myItem is:
interface IMyItem {
id: number;
dataOfField1: string;
dataOfField2: number;
dataOfField3: EMyItemState;
}
const enum EMyItemState {
State1 = 'state1',
State2 = 'state2',
...
State<N> = 'state<n>'
}
Input data distinctData1, distinctData2 and distinctData3 used in angular's component of app-mycontrol-filter.
In this case, the standard filter does not work.
How can I organize a filter on an objects (type is IMyItem) associated with a column using all the properties of the object?