Grid.Blazor icon indicating copy to clipboard operation
Grid.Blazor copied to clipboard

Filter on Collection property

Open HristoS opened this issue 3 years ago • 0 comments

Describe the bug Filter is not properly generated for collection property

To Reproduce I have model like Order{ ICollection<Client> 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.

HristoS avatar Jun 03 '22 11:06 HristoS