I copied this from a post in made in 2012. This is exactly what is happening in my application. Any pointers on how to get around it? Everything works fine until I try to filter on more than one column.
I am trying to implement server side filtering using the Kendo UI Grid and ASP .NET Web API RC. It works fine with one column, but when the user filters on a second column issues occur. The values for the second column seem to be included in the array of values for column one. How can I parse this on the server?
I am including the JSON format of the data being passed to the server because it is easier to read. Normally I have to pass the values in the query string. If the JSON format could be used that would be better (so let me know if anyone knows how):
{"take":10,"skip":0,"page":1,"pageSize":10,"filter":{"filters":[{"field":"Column1","operator":"eq","value":"val1"},{"field":"Column1","operator":"eq","value":"val2"},{"logic":"or","filters":[{"field":"Column2","operator":"eq","value":5},{"field":"Column2","operator":"eq","value":1}]}],"logic":"and"},"group":[]}
Here are the c# objects for the mapping that I found online that currently only works with one column. PageListArguments is the object that is used as the input parameter for the Get function of the Web API Controller.
public class GridFilter
{
public string Field { get; set; }
public string Operator { get; set; }
public string Value { get; set; }
}
public class GridFilters
{
public List<GridFilter> Filters { get; set; }
public string Logic { get; set; }
}
public class GridSort
{
public string Field { get; set; }
public string Dir { get; set; }
}
public class PageListArguments
{
public int Take { get; set; }
public int Skip { get; set; }
public int Page { get; set; }
public int PageSize { get; set; }
public string Group { get; set; }
public List<GridSort> Sort { get; set; }
public GridFilters Filter { get; set; }
}
Everything parses fine except for the filter when more than one column is used.