Hi Breno,
Greetings from Syncfusion Support.
Query: “Initiate filter unchecked”
Based on your query, we analyzed that you want to uncheck
all the checkboxes in the filter initially and select only one checkbox. So we
suggest you to set the filter predicate object in filterSettings.columns that specify the columns to be
filtered at the initial rendering of the Grid.
For your reference, we have prepared a sample based on your
requirement that selects only one checkbox value “Alejandra Camino“
of the CustomerName column initially.
Kindly check the below code and sample for reference.
Sample code:
Index.ts
public filterOptions:
FilterSettingsModel = {
columns:
[
{
field: 'CustomerName',
matchCase: false,
operator: 'equal',
predicate: 'or',
value: 'Alejandra Camino',
}, }
]
};
<GridComponent dataSource={data} allowFiltering={true} filterSettings={this.filterOptions}
height={273}>
<ColumnsDirective>
<ColumnDirective field='OrderID' width='100'
textAlign="Right"/>
<ColumnDirective field='CustomerID' width='100'/>
<ColumnDirective field='Freight' width='100' format="C2"
textAlign="Right"/>
<ColumnDirective field='ShipCity' width='100'/>
<ColumnDirective field='ShipName' width='100'/>
</ColumnsDirective>
<Inject
services={[Filter]} />
</GridComponent>
|
Sample: https://stackblitz.com/edit/react-9t4b5m?file=index.js
Kindly check the below documentation for more information.
Documentation:
https://ej2.syncfusion.com/react/documentation/grid/filtering/filtering/#initial-filter
API:
https://ej2.syncfusion.com/react/documentation/api/grid/filterSettingsModel/#columns
https://ej2.syncfusion.com/react/documentation/api/grid/predicate/
Please get back to us if you need further assistance on
this.
Regards,
Nithya Sivaprakasam.