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?
Hi!
I implemented a filter over all columns to implement a search like the example in the Overview-section for the Grid component.
I would like to highlight all text in the columns yellow that match the entered search text.
Is that easily possible?
Best regards,
Gerald
Hello,
I'm planning on migrating an old AngularJS 1.5.5 (working with KendoUI) to latest angular 17.X with Kendo UI and I have some questions about Odata integration.
Is filtering, paging and sorting working "built-in" with odata ? I couldn't find any documentation forfiltering, for ex, with odata.
Do you have any example ?
Kind regards,
Musab
Hi!
i want replace a input text with a dropdownlist-filter inside this default filter, i need to keep this filter: CONTAINS ... - AND / OR - CONTAINS ...
Can someone help me?
Thanks!!
export class CustomMultiSelectFilterComponent implements AfterViewInit {
@Output() public handleFilterChange = new EventEmitter<CompositeFilterDescriptor>()
@Input() public data: string[] = []
@Input() public textField: string = ""
@Input() public valueField: string = ""
@Input() public filter: CompositeFilterDescriptor = { logic: "or", filters: [] }
@Input() public preFilterValue: string | null = null
@Input() public filterService: FilterService
@Input() public currentFilter: CompositeFilterDescriptor = { logic: "or", filters: [] }
public constructor(
filterService: FilterService
) {
this.filterService = filterService
}
public filterChange(filter: CompositeFilterDescriptor): void {
this.filter = filter
this.data = filterBy(this.data , filter)
this.handleFilterChange.emit(filter)
}
public onChange(values: string[], filterService: FilterService): void {
filterService.filter({
filters: values.map((value) => ({
field: this.valueField,
operator: "contains",
value,
})),
logic: "or",
})
}
public ngAfterViewInit(): void {
if (this.filterService) {
this.filterService.changes.subscribe((filter: CompositeFilterDescriptor) => {
this.currentFilter = filter
console.log("Current Filters:", this.currentFilter)
})
}
}
}
<kendo-multiselect
[data]="data"
[valuePrimitive]="true"
[textField]="textField"
[valueField]="valueField"
[value]="filter | filterValues"
(valueChange)="onChange($event, filterService)"
>
</kendo-multiselect>
<kendo-grid
kendoGridSelectBy="id"
[kendoGridBinding]="users"
filterable="menu"
[sortable]="true"
[resizable]="true"
(selectionChange)="selectionChange($event)"
[selectable]="selectableSettings"
[selectedKeys]="[selectedKeyArray]"
(filterChange)="handleFilterChange($event)"
[filter]="filter"
>
<kendo-grid-column-group title="{{ 'literal:Users | Total:' | translate }} {{ users.length }}" [columnMenu]="true">
<kendo-grid-column field="roles" title="{{ 'literal:Roles' | translate }}" [width]="220" [headerStyle]="{ 'font-weight': 'bold' }">
<ng-template kendoGridFilterMenuTemplate let-filter="filter" let-filterService="filterService">
<app-custom-multiselect-filter
[data]="rolesToFilter"
textField="rolesToFilter"
valueField="filterRoles"
[preFilterValue]="preFilter"
[filterService]="filterService"
[currentFilter]="filter"
>
</app-custom
Hello!
Our customer complained that when trying to enter a decimal point in the numeric filter of the grid, it appears and then immediately disappears. This effect appeared after upgrading the kendo-angular-grid package from version 4.7.0 to version 11.2.0 (we also upgraded the Angular version from version 10 to 15). I noticed that the same effect is present on your site
https://www.telerik.com/kendo-angular-ui/components/grid/filtering/filter-menu/
Notice the Order column in the 1st example there. Please open a filter for it and try to quickly (as fast as possible) enter a number and then a dot in the top input of the filter.
The same thing happens in the other examples on this page that have a numeric filter. Interestingly, there is no such effect in the lower inputs.
So my questions are:
1. is this a defect?
2. is it possible to fix this behaviour without changing the version of the kendo-angular-grid package? I mean, maybe there is a possibility to intercept an input event in the filter input in an Angular component code.
I have a scenario, where I have to filter the grid based on a Boolean column.
for ex: "isMember" is a boolean field with "yes" or "No" values
The user can filter records with :
"yes":- to see only member records,[checked= true]
"No":- to see non-member records[checked = fslse]
and "both yes and No":- to see all records[checked=null]
The Prime-ng has a p-triStateCheckbox component to implement this scenario.
Do we have something similar in kendo to implement this scenario?
Hi team,
On the external filtering sample under the grid, I wanted a filter condition like the below :
(Product Name starts with 'c' And Product Name ends with 'i') OR Product Name is equal to 'Ikura'
Using this filter, I expected to get chai and ikura as filtered results. but the filter gave me zero results back.
Can you please tell me why this selection of filters gave no results back? Also, what filters do I need to use to accomplish my requirement of getting chai and ikura as my results?
I am attaching the screen capture of my selected filter options for your reference.
Regards,
Naresh Ravlani.