I've got a strange case with an in-grid dropdown filter that, for some reason, will bind to the first seven or eight of twenty-one objects in an array but will send back an empty array when sending back to vmUserFilters and vmUserChange as well as having the dropdown vanish when users after the eighth or ninth record are selected. One work-around is selecting a name in the first seven records and then adding a record between the ninth and twenty-first and removing the first added however I don't think our client will accept that arrangement. Below is the grid column and dropdown in question:
<kendo-grid-column field="currentHolderId" title="Sales Person" width="100">
<ng-template kendoGridFilterMenuTemplate
let-column="column"
let-filter="filter"
let-filterService="filterService">
<kendo-multiselect [data]="vmusers"
textField="userName"
valueField="id"
[valuePrimitive]="true"
[value]="vmUserFilters(filter)"
(valueChange)="vmUserChange($event, filterService)">
</kendo-multiselect>
</ng-template>
<ng-template kendoGridCellTemplate let-dataItem>
{{vmuserFind(dataItem.currentHolderId)?.userName}}
</ng-template>
</kendo-grid-column>
Some additional information from my code:
The functions referenced above:
public vmUserFilters(filter: CompositeFilterDescriptor): FilterDescriptor[] {
return flatten(filter).map(({ value }) => value);
}
public vmUserChange(values: any[], filterService: FilterService): void {
filterService.filter({
filters: values.map(value => ({
field: 'currentHolderId',
operator: 'eq',
value
})),
logic: 'or'
});
}
The interface for the vmusers array:
export interface IVMUser {
id: string
userName: string
role: string
}
Let me know if you can think of anything that could be causing this issue behind the scenes or what I might need to add/update. I can verify that these values are consistent - ie. id is a unique identifier, userName is a first and last name, role is a single-word string.
Thank you!