This works fine when loading the grid items. However, when I do it this way, the column filters that are .Multi(true) do NOT use this function, and pass no variables to the Action method.
How do I get the calls to load the filters to also use this function for parameters?
4 Answers, 1 is accepted
I tested this line in a project and the parameter was sent with every request. I am attaching the test project for reference. The exact code I use is this:
Could you tell what changes I need to make to reproduce the issue?
The post is about column filters with Multi(true) -- filters that call the controller for the datasource so they can get the options for the filter.
Add this to the ShipCity column definition: .Filterable(f => f.Multi(true))
Then click on the Filter button for the Ship City column. You will see that the data function is not called, and "prop" is not passed to the controller.
I was able to resolve the issue by using getOptions and setOptions to set the data function.
Let me know if you see any issue setting it this way. It appears to be working correctly.
Sorry for mistaking the multiple-option filter for multi-column sorting. I understand what you mean now, but this is expected behavior. The multi-checkbox filter uses a separate DataSource, which is created using the options that were initially passed for the Grid DataSource. When you add the data function at run time, it is not added to the filter DataSource.
The easiest solution would be to declare a standalone DataSource and use it for the multi-checkbox filter:
And then, you can add a data function to this DataSource, too: