This repository was archived by the owner on Jun 1, 2025. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 19
Input Filter
Ghislain B edited this page Feb 10, 2018
·
27 revisions
Input filter is the default filter when enabling filters.
Simply set the flag filterable to True and and enable the filters in the Grid Options. Here is an example with a full column definition:
// define you columns, in this demo Effort Driven will use a Select Filter
this.columnDefinitions = [
{ id: 'title', name: 'Title', field: 'title' },
{ id: 'description', name: 'Description', field: 'description', filterable: true }
];
// you also need to enable the filters in the Grid Options
this.gridOptions = {
enableFiltering: true
};When using a regular grid with a JSON dataset (that is without using Backend Service API), the filter might not working correctly on cell values that are translated (because it will try to filter against the translation key instead of the actual formatted value). So to bypass this problem, a new extra params was created to resolve this, you need to set useFormatterOuputToFilter to True and the filter will, has the name suggest, use the output of the Formatter to filter against. Example:
// define you columns, in this demo Effort Driven will use a Select Filter
this.columnDefinitions = [
{ id: 'title', name: 'Title', field: 'id',
headerKey: 'TITLE',
formatter: this.taskTranslateFormatter, // <-- this could be a custom Formatter or the built-in translateFormatter
filterable: true,
params: { useFormatterOuputToFilter: true } // <-- set this flag to True
},
{ id: 'description', name: 'Description', field: 'description', filterable: true }
];
// you also need to enable the filters in the Grid Options
this.gridOptions = {
enableFiltering: true
};
// using a custom translate Formatter OR translateFormatter
taskTranslateFormatter: Formatter = (row, cell, value, columnDef, dataContext) => {
return this.translate.instant('TASK_X', { x: value });
}Contents
- Aurelia-Slickgrid Wiki
- Installation
- Styling
- Interfaces/Models
- Testing Patterns
- Column Functionalities
- Global Grid Options
- Localization
- Events
- Grid Functionalities
- Auto-Resize / Resizer Service
- Resize by Cell Content
- Add/Delete/Update or Highlight item
- Dynamically Change Row CSS Classes
- Column Picker
- Composite Editor Modal
- Context Menu
- Custom Tooltip
- Excel Copy Buffer
- Export to Excel
- Export to File (CSV/Txt)
- Grid Menu
- Grid State & Presets
- Grouping & Aggregators
- Header Menu & Header Buttons
- Header Title Grouping
- Pinning (frozen) of Columns/Rows
- Row Colspan
- Row Detail
- Row Selection
- Tree Data Grid
- SlickGrid & DataView objects
- Addons (controls/plugins)
- Backend Services