Hi Christian,
Greetings from Syncfusion support.
Please find the response for your queries below,
Query – 1: “Is there a way to Only show one column like this”
The Grid’s filtering functionality works on basis of comparing the filtered value with the corresponding column field data in the underlying data source bound to the grid. So the filter dialog renders the corresponding column values as checkbox list. This is its default behavior.
However you can customize this list to set a custom data source to the checkbox filter for the required columns by assigning filter data source to the filter model in the Grid’s actionBegin event handler. Please ensure the custom data source is present in the column field data since the filtering action is performed based on the data source value as mentioned above.
This is demonstrated in the below code snippet,
|
// ‘Priority’ here is the column field where custom data source is set
var filterData = [
{ Priority: 'Message' },
{ Priority: 'Warning' }
]
// Grid’s actionBegin event handler
function onActionBegin(args) {
if (args.requestType === 'filterbeforeopen' && args.columnName === 'Priority') {
// Modifying filter datasource
args.filterModel.options.dataSource = filterData;
}
} |
Note: On using this approach, the custom filter data source set column will not display any data in the checkbox filter when checking after applying filter for other columns. This is because the checkbox filter list will be generated based on the previous filter predicates.
Query – 2: “Is possible starts checkbox starts un unchecked”
The filter checkbox list values will be unchecked when they are filtered out in the current column. Like for e.g., consider the below image,
Here the ‘Argentina’ value is unchecked because it is filtered out from the ‘ShipCountry’ column and so it will not be displayed in the Grid until the filter action is cleared. So if this is your requirement then you can achieve it by setting initial filter settings for the required column using the ‘notEqual’ filter operator to check out that value in the filter checkbox list.
More details on this can be checked in the below documentation link,
Please get back to us if you require any further assistance.
Regards,
Sujith R