Megabit / Blazorise

Blazorise is a component library built on top of Blazor with support for CSS frameworks like Bootstrap, Tailwind, Bulma, AntDesign, and Material.
https://blazorise.com/
Other
3.26k stars 526 forks source link

Feature request: Custom filtering for DataGrid #394

Closed paiden closed 4 years ago

paiden commented 4 years ago

Is your feature request related to a problem? Please describe. The current filter operates on a per field basis as far as I can tell and only supports the given filter methods. I'd like to see a API to allow setting custom filters for a row to e.g. allow deep filtering etc.

Describe the solution you'd like

<TextBox @bind-Text="@this.ItemText" />
<DataGrid TItem="DataItem" CustomFilter="@this.ItemFilter"... />
string ItemText {get;set;}
static bool ItemFilter(DataItem item) 
   => item.Name.Equals(this.ItemText) || item.Description.Contains(this.ItemText);

Ideally there also is some way to trigger the filter when needed, e.g.

I have no idea if and how this can be implemented in Blazor in a performant way, I'm not experienced enough with this tech yet, but I hope you get the idea I'm outlining here. Maybe there is a much better way to implement custom filtering with Blazor.

BTW: Thank you very much for this awesome project, It saves me a lot of time for one of my hobby projects.

stsrki commented 4 years ago

Hi @paiden

This is a good idea and I think it shouldn't be a problem to implement. Going on the list!

stsrki commented 4 years ago

PS. I would really like to know how people are using Blazorise so if you have your project somewhere I would like to have a look :)

paiden commented 4 years ago

PS. I would really like to know how people are using Blazorise so if you have your project somewhere I would like to have a look :)

It's a little too early to show this to someone else than myself. But once it is in a state I'm OK with showing to others, I hopefully will remember to give you and update so you can take a look.