Skip to content
IzzyBlazor 0.1.0-alpha.20

Enter all results ↑ ↓ move Esc close

Filtering

A filter in each column's header, lists of values, operators, and filters in the address.

The members for filtering, and the types they use. Every member of IzzyBlazor.Table<TItem> is on the Table API.

Properties (4)

@bind-FilterFilter?Added in 0.1.0-alpha.20 @bind: Interactive only

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.

FilterCaseFilterCase = FilterCase.IgnoreCaseAdded in 0.1.0-alpha.20

How text compares in the column filters and search. Defaults to FilterCase.IgnoreCase, which lowers both sides. FilterCase.Database compares text as it is and leaves it to the database's collation, so an index can serve it. An export endpoint sets Case on its own fields, or the file and the screen can differ.

FilterPanelbool = falseAdded in 0.1.0-alpha.20

A 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.

FilterFromAddressbool = falseAdded in 0.1.0-alpha.20

Applies a whole filter from the address (?filter=, with the QueryPrefix), as a FilterBuilder<T> on the page writes it, along with the columns' own. Off by default, as the page may use that name itself.

Parts (2)

Components written inside Table, and the columns' members, which PropertyColumn and TemplateColumn 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 = false

Adds 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.

FilterOperatorsIReadOnlyList<FilterOperator>?Added in 0.1.0-alpha.20

The operators this column's filter offers, the first being the default, such as [FilterOperator.GreaterThanOrEqual, FilterOperator.Between]; a condition with any other matches nothing, whoever writes it. With more than one, a Table's column chooses in a Select as a DataGrid's does. For text, numbers and dates.

FilterFunc<FieldFilter, Expression<Func<TItem, bool>>?>?Added in 0.1.0-alpha.20

Builds this column's filter condition yourself, for a computed value or one stored differently from how it's shown. It gets the condition (operator and values parsed for the column's type) and returns the filter on the item, or null for the usual one. See Filter.

FilterValuesFilterValuesLoader?Added in 0.1.0-alpha.20

Makes this column's filter a list of checkboxes with a search, its values found here when the panel opens: a page at a time, narrowed by the other filters, and loading more on scroll. Use ToResultAsync to read them from a query. On a static page the script asks the page's own address for them, so a search renders the page again. With no script, the column shows its usual filter. Not with FilterOperators.

Without JavaScript: With JavaScript off, the column shows its usual filter in place of the list.

FilterListbool = falseAdded in 0.1.0-alpha.20

As FilterValues, reading a text column's values from the table's Items. With an ItemsProvider there's nothing to read, so use FilterValues.

Without JavaScript: With JavaScript off, the column shows its usual filter in place of the list.

FilterTemplateRenderFragment<FilterTemplateContext>?Added in 0.1.0-alpha.20

This column's own controls, in its filter panel above Clear and Apply. Spread the context's Attributes on a control and its value filters by the column's first operator, or several values by FilterOperator.In. With Filter, a value can mean anything. Works with no script. In a filter row, the cell opens the panel. Not with FilterValues or FilterList.

FilterTextFunc<IReadOnlyList<string?>, string>? (computed)Added in 0.1.0-alpha.20

What a FilterTemplate's filter says in its row and tag, given its values, for values that aren't what people read. Defaults to the values themselves.

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 = false

Adds 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.

FilterOperatorsIReadOnlyList<FilterOperator>?Added in 0.1.0-alpha.20

The operators this column's filter offers, the first being the default, such as [FilterOperator.GreaterThanOrEqual, FilterOperator.Between]; a condition with any other matches nothing, whoever writes it. With more than one, a Table's column chooses in a Select as a DataGrid's does. For text, numbers and dates.

FilterFunc<FieldFilter, Expression<Func<TItem, bool>>?>?Added in 0.1.0-alpha.20

Builds this column's filter condition yourself, for a computed value or one stored differently from how it's shown. It gets the condition (operator and values parsed for the column's type) and returns the filter on the item, or null for the usual one. See Filter.

FilterValuesFilterValuesLoader?Added in 0.1.0-alpha.20

Makes this column's filter a list of checkboxes with a search, its values found here when the panel opens: a page at a time, narrowed by the other filters, and loading more on scroll. Use ToResultAsync to read them from a query. On a static page the script asks the page's own address for them, so a search renders the page again. With no script, the column shows its usual filter. Not with FilterOperators.

Without JavaScript: With JavaScript off, the column shows its usual filter in place of the list.

FilterListbool = falseAdded in 0.1.0-alpha.20

As FilterValues, reading a text column's values from the table's Items. With an ItemsProvider there's nothing to read, so use FilterValues.

Without JavaScript: With JavaScript off, the column shows its usual filter in place of the list.

FilterTemplateRenderFragment<FilterTemplateContext>?Added in 0.1.0-alpha.20

This column's own controls, in its filter panel above Clear and Apply. Spread the context's Attributes on a control and its value filters by the column's first operator, or several values by FilterOperator.In. With Filter, a value can mean anything. Works with no script. In a filter row, the cell opens the panel. Not with FilterValues or FilterList.

FilterTextFunc<IReadOnlyList<string?>, string>? (computed)Added in 0.1.0-alpha.20

What a FilterTemplate's filter says in its row and tag, given its values, for values that aren't what people read. Defaults to the values themselves.

Types (6)

FieldFilter

record

A condition on one field: total ge 100. The values are parsed for the field's type when the filter is applied (text as the person writes it in the current culture, or the invariant form); a value that doesn't parse matches nothing.

FieldFilter members
MemberDescription
Field string

The field's key.

Operator FilterOperator

How the field's value compares.

Value object?

The value to compare with. For FilterOperator.In and FilterOperator.NotIn, a list of values; for FilterOperator.Between, the lower end (null for none).

Value2 object?

The upper end for FilterOperator.Between (null for none).

MatchCase bool

For text: match upper and lower case exactly, and for equality, spaces too. Text ignores case by default.

Values IReadOnlyList<object?>

The values of an FilterOperator.In or FilterOperator.NotIn condition (a single value is a list of one).

Filter

record

A 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.

Filter members
MemberDescription
Parse(string text)

Reads a filter written in the subset of OData's $filter that ?filter= takes: total ge 100 and (status in ('Paid','Pending') or customer contains 'ada'). Comparisons (eq ne gt ge lt le), in, and or not, parentheses, contains, startswith and endswith (as functions or between field and value), date(field) eq 2026-01-31 for a day, and null. Text matches ignoring case, as a Table's filters do (OData's own contains matches case).

Find(string field)

The condition on field that every match must meet: this filter itself, or one inside its and groups (not inside an or group or a not). Null when there's none. For a provider that passes conditions on to an API: request.Filter?.Find("who")?.Value.

FilterCase

enum

How text compares in a filter.

FilterCase values
ValueDescription
IgnoreCase

Upper and lower case are the same: both sides are lowered, which a database index can't serve. The default.

MatchCase

Upper and lower case differ, as far as the data's own comparison goes: text is compared as it is. In memory, that's exact. A database still has its say: SQLite's LIKE, which EF Core uses for a starts-with or ends-with, ignores case in ASCII.

Database

Text is compared as it is, and the database's collation decides, so an index can serve it. On a list in memory, that's the same as FilterCase.MatchCase.

FilterOperator

enum

How a FieldFilter compares. Which ones a field takes depends on its type: text takes the text operators, equality, the lists and the empty checks; numbers and dates the comparisons, FilterOperator.Between and the lists, and dates FilterOperator.OnDay; enums, booleans and Guids equality and the lists. Types that can be null add the null checks. An operator a field doesn't take matches nothing.

FilterOperator values
ValueDescription
Equals

Equal to the value (text ignores case unless MatchCase). With a null value, the same as FilterOperator.IsNull.

NotEquals

Not equal to the value.

LessThan

Less than the value.

LessThanOrEqual

Less than or equal to the value.

GreaterThan

Greater than the value.

GreaterThanOrEqual

Greater than or equal to the value.

Between

From Value to Value2, both included; a null end has no limit.

Contains

Text that contains the value.

DoesNotContain

Text that doesn't contain the value (or is null).

StartsWith

Text that starts with the value.

EndsWith

Text that ends with the value.

In

Any of the values in Value, a list.

NotIn

None of the values in Value, a list.

IsNull

No value.

IsNotNull

Any value.

IsEmpty

Text that is empty or null.

IsNotEmpty

Text that has at least one character.

OnDay

A date on the day in the value. A DateTime keeps the day's range (an index can serve it); a DateTimeOffset compares the day on the clock where it was recorded, which EF Core can't translate on SQLite.

FilterTemplateContext

class

What a column's FilterTemplate gets: the filter as it stands, and what its controls need to change it. Spread Attributes on a control and it works on every kind of page; its value still needs setting.

FilterTemplateContext members
MemberDescription
Name string

The column's key in the address, such as f-total, which its value posts under.

Operator FilterOperator

The operator its value applies with: the column's first in FilterOperators, or its usual one.

Values IReadOnlyList<string?>

The values it's set to, none when it isn't. More than one makes an FilterOperator.In.

Value string

The first of Values, or "".

To string

The upper end, for a column whose operator is FilterOperator.Between, or "".

IsFiltered bool

Whether the column is filtered.

Attributes IReadOnlyDictionary<string, object>

For a control that holds the one value, such as an input, a select or a library field: its name and form on a page that keeps filters in the address, its change event on a page that binds them. A library field also needs SetAsync as its ValueChanged.

ToAttributes IReadOnlyDictionary<string, object>

As Attributes, for a control that holds the upper end of a FilterOperator.Between.

object> CheckboxAttributes(string value)

For a native checkbox that adds this value: as Attributes, with its type, value and whether it's ticked.

Has(string value)

Whether this value is among Values.

SetAsync(string? value)

Filters by this value on an interactive page, or removes the filter with null or "".

SetValuesAsync(IEnumerable<string?> values)

Filters by these values on an interactive page, or removes the filter with none.

FilterValuesLoader

delegate

Finds the values a column's filter can list. It must keep what's ticked listed; the library adds any it leaves out.

FilterValuesLoader members
MemberDescription
Target object?
Method MethodInfo
BeginInvoke(FilterValuesRequest request, AsyncCallback callback, object object)
EndInvoke(IAsyncResult result)
Invoke(FilterValuesRequest request)

Connection lost

Rejoining the server…