BlazorTable
BlazorTable copied to clipboard
Support programmatic filtering
This is a feature request to support programmatic filtering. My use case stems from having a page with a table that can be navigated to with query parameters (imagine /list?column1=a&column2=b...). My goal is to feed these query parameters directly into the table so that the user doesn't have to fill out the filters when the page loads.
I've had partial success with something like this:
var column = Table.Columns.First(c => c.Title == "Full name");
column.Filter = model => model.FullName.Contains(FullNameParameter);
But this doesn't work out because the StringCondition isn't filled out.
I am not sure how this should be designed since the FilterControls on the columns aren't instantiated until a user manually clicks the filter icon.
Ideally, there could be support at the Table level:
Table<TItem> table;
table.ApplyFilter("Column Title", StringCondition.Contains, "FilterValue");
table.ApplyFilter("Other Column Title", NumberCondition.IsEqualTo, 1);
table.ApplyFilter("XYZ", BooleanCondition.IsTrue);
table.ApplyFilter("ABC", EnumCondition.IsEqualTo, SomeEnum.Member);
...
table.RemoveFilter("Column Title");