When applied filter in kendo grid i am getting filter as object like below
filter : { filters : [], logic : "and"}
But in some kendo examples filter is displaying like
filter : "producatname~eq~test"
How to change filter from object to string
Assuming you are writing JavaScript code in a web page and want to convert the filter data to a string suitable for sending or saving, you can use transport.parameterMap to convert filters to a string.
const grid = $("#grid").data("kendoGrid");
const parameterMap = grid.dataSource.transport.parameterMap;
const filterString = parameterMap({filter: grid.dataSource.filter()}).filter
On the MVC side you can then use Kendo.Mvc.Infrastructure.FilterDescriptorFactory.Create(string) to parse the string.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With