Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Filter on Collection property #346

Open
HristoS opened this issue Jun 3, 2022 · 0 comments
Open

Filter on Collection property #346

HristoS opened this issue Jun 3, 2022 · 0 comments

Comments

@HristoS
Copy link

HristoS commented Jun 3, 2022

Describe the bug
Filter is not properly generated for collection property

To Reproduce
I have model like
Order{
ICollection Clients {get; set;}
}

I've added grid column like
columns.Add(o => o.Clients)
.Titled(LocTabHeader("Clients"))
.RenderValueAs(o => String.Join(",", o.Clients.Select(x => Clients.FirstOrDefault(c => c.Value == x.ClientId.ToString())?.Title ?? x.ClientId.ToString())))
.SetFilterWidgetType("ClientsFilterComponent")
.Filterable(true)
Where for ClientsFilterComponent i've followed https://github.com/gustavnavar/Grid.Blazor/blob/master/docs/blazor_client/Creating_custom_filter_widget.md with the difference in ApplyButtonClicked

await GridHeaderComponent.AddFilter(new FilterCollection("/any", $"(c: c/ClientId eq {_filterValue})"))

so i've expected filter to be generated like
filter=(tolower(MysteryJackpotInstanceClients)/any(c: c/clientid+eq+'2')) so that I can search in the expandable collection, but instead filter is filter=(tolower(MysteryJackpotInstanceClients)+eq+'(c:+c/clientid+eq+2)'

Expected behavior
filter=(tolower(MysteryJackpotInstanceClients)/any(c: c/clientid+eq+'2')).

Screenshots
If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

  • OS: [e.g. iOS]
  • Browser [e.g. chrome, safari]
  • Version [e.g. 22]

Smartphone (please complete the following information):

  • Device: [e.g. iPhone6]
  • OS: [e.g. iOS8.1]
  • Browser [e.g. stock browser, safari]
  • Version [e.g. 22]

Additional context
Add any other context about the problem here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant