Filtering
Since 0.1.0-alpha.24
The members for filtering, and the types they use. Every member of
IzzyBlazor.TreeList<TItem> is on the TreeList API.
Properties (4)
FilterBranchbool = falseWhile filtering or searching, keeps the rows under a match too, not only the match and the rows above it: a search for a department shows its people.
Searchablebool = falseA search box in the toolbar, across the text columns. The words go in the address (?search=) and reach an ItemsProvider as the request's Search. With no script they apply on Enter.
@bind-FilterFilter?The filter: Filter.All of a condition per filtered column (contains for text, between for numbers, equals for dates, equals or in for choices), or null for none. Binding it (@bind-Filter) on an interactive page keeps filters, sort and page in the component instead of the URL. Set it in C#, such as Filter.Where("status", FilterOperator.Equals, "Paid"); a condition no column's panel can show still applies, and shows as a tag that removes it.
FilterPanelbool = falseA row below the rows that lists the active filters, each with a button to remove it, and Clear for all of them. It's there whether or not anything is filtered, so nothing moves.
Parts (1)
Components written inside TreeList, and the columns' members, which PropertyColumn, TemplateColumn and DynamicColumn share.
PropertyColumn<TItem, TValue>
A column that shows one property of each item, formatted, and can sort by it. The title and sort key come from the property ([Display(Name)] is used when present).
Filterablebool = falseAdds a filter button to this column's header. In a Table: a text box for text (matching anywhere, ignoring case), Min and Max boxes for numbers (keeping the values between them; either may be empty), a date input for dates (matching the day), a list of checkboxes for enums and booleans. In a DataGrid, text, numbers and dates choose an operator above the value. A TemplateColumn<T> filters by its FilterBy text.
Types (1)
Filter
recordA filter on data: a condition on one field (FieldFilter), conditions joined by and or or (FilterGroup), or the opposite of one (NotFilter). Fields are named by their key (a column's SortKey, or a DataField<T>'s Key). It becomes a LINQ expression on the fields' own properties, so an EF Core query filters in the database; a value never becomes code.
| Member | Description |
|---|---|
Parse(string text) | Reads a filter written in the subset of OData's |
Find(string field) | The condition on |