You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: components/grid/templates/filter.md
+97Lines changed: 97 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -17,6 +17,7 @@ There are two different templates you can use depending on the [Filter Mode]({%s
17
17
18
18
*[Filter Row Template](#filter-row-template)
19
19
*[Filter Menu Template](#filter-menu-template)
20
+
*[Filter Menu Buttons Template](#filter-menu-buttons-template)
20
21
21
22
22
23
## Filter Row Template
@@ -165,6 +166,8 @@ To customize the filter menu, use the `<FilterMenuTemplate>` tag of the `<GridCo
165
166
The template receives a `context` of type `FilterMenuTemplateContext` that provides the following members:
166
167
167
168
*`FilterDescriptor` - the object that describes the column filter. By default it has two filters with the type and name of the field, and you can add more to its `FilterDescriptors` collection, or change its `LogicalOperator` from the default `AND`.
169
+
*`FilterAsync` - applies the defined filters in the Filter Menu to the Grid component.
170
+
*`ClearFilterAsync` - clears the applied filters.
168
171
169
172
You can store a reference to each column's context in a field in the view-model, so you can reference it from event handlers in the standard C# code, instead of passing it as a nargument to lambdas in the markup only. You can also pass the context as a Parameter to your own separate filter component to reduce clutter in the main grid markup and code.
170
173
@@ -305,6 +308,100 @@ For an example with the CheckboxList Filter, see the [Custom Data]({%slug grid-c
305
308
306
309

307
310
311
+
## Filter Menu Buttons Template
312
+
313
+
By default, the Filter Menu renders `Filter` and `Clear` buttons. You can customize or remove them entirely by using the `FilterMenuButtonsTemplate` tag.
314
+
315
+
The template receives a `context` of type `FilterMenuTemplateContext` that provides the following members:
316
+
317
+
*`FilterDescriptor`—the object that describes the column filter. By default, the column filter has two filters: one for the type and another for the name of the field. You can modify the column filter by:
318
+
* Adding more filters to the `FilterDescriptors` collection.
319
+
* Changing the `LogicalOperator` (`AND` by default).
320
+
* Using the `FilterDescriptor` to create a custom button that applies a predefined filter.
321
+
*`FilterAsync`—applies the filters defined in the Filter Menu to the Grid component.
0 commit comments