0" doesn't work 0" doesn't work 0" doesn't work

devextreme angular - to set a initial filter value of a DxDataGrid custom headerFilter

2.2k Views Asked by At

How to set a starting headerFilter value if it contains a custom expresion like this? to set filterValues="xxx > 0" doesn't work

<dxi-column caption="" dataField="xxx" [headerFilter]="headerFilter" filterValues="xxx > 0"></dxi-column>


headerFilter: any = {
    dataSource: [ {
        text: "to do",
        value: ["xxx", "=", 0]
    }, {
        
        text: "done",
        value: [["xxx", ">", 0]]
    },]
};
  
1

There are 1 best solutions below

0
Filipe Nóbrega On

You are calling the filter value the wrong way. Try the following:

<dx-data-grid ...
    [filterSyncEnabled]="true"
    [filterValue]="['xxx', '>', 0]"> 

    <dxo-header-filter 
        [visible]="true">
    </dxo-header-filter>

    <dxi-column caption="" dataField="xxx" [headerFilter]="headerFilter">
    </dxi-column>
...
</dx-data-grid>