我正在尝试过滤 Kendo UI 网格服务器端过滤器。开发人员工具在查询字符串中显示了这一点
/Home/GetUsmMessage?{"filter":{"logic":"and","filters" [{"field":"MessageId","operator":"eq","value":1}]},"组”:[]} GET 200 应用程序/json
我创建了一个对象结构,以便将结构读取到对象
public ActionResult GetUsmMessage(FilterContainer filter)
{
//Code to read the filter container
return Json(jsonData, JsonRequestBehavior.AllowGet);
}
过滤容器的对象结构:
public class FilterContainer
{
public List<FilterDescription> filters { get; set; }
public string logic { get; set; }
}
public class FilterDescription
{
public string @operator { get; set; }
public string field { get; set; }
public string value { get; set; }
public List<FilterDescription> filters { get; set; }
public string logic { get; set; }
}
当我调试控制器功能时,它仍然给我一个空对象。请帮忙