Hi,
To apply a filter to a datafield you can create a column with this datafield and set the column property ‘hidden’ to true.
This way you won’t have an extra column.
dataSource = new jqx.dataAdapter({
localData: this.data,
dataFields: [
{ name: 'id', type: 'number' },
{ name: 'name', type: 'string' },
{ name: 'someProp', type: 'string' }
]
});
columns = [
{ text: 'Id', datafield: 'id', hidden: true },
{ text: 'Name', datafield: 'name' },
{ text: 'SomeProp', datafield: 'someProp' },
];
ngAfterViewInit(): void {
let filtergroup = new jqx.filter();
let filtervalue = 5;
let filtercondition = 'less_than';
let filter1 = filtergroup.createfilter('numericfilter', filtervalue, filtercondition);
this.grid.addfilter('id', filter1, true);
this.grid.applyfilters();
}
Best regards,
Svetoslav Borislavov
jQWidgets Team
https://www.jqwidgets.com/