Kendo Grid Server Side过滤将null作为过滤器对象发送到后端

时间:2018-09-18 12:49:01

标签: angularjs kendo-ui kendo-grid kendo-asp.net-mvc

使用Kendo AngularJS和ASP .NET MVC,我正在尝试将网格的过滤器对象发送到后端。但是,即使我将serverFiltering设置为true,在前端进行的所有过滤器在请求中都为null。

enter image description here

grid.dataSource = new kendo.data.DataSource({
    serverFiltering: true,
    transport: {
        read: {
              url: "api/foo",
              dataType: "json",
              type: "POST"
              }
     },
     schema: {
          data: "data", // records are returned in the "data" field of the response      
          total: "total"
    }
    });

//set grid to filterable
grid.filterable = {
    mode: 'row',
    operators: {
         string: {
                 contains: "contains"
                 }
     }
 };

我看了一个similar question,但是它对我没有帮助,因为我无法复制列为可接受答案的解决方案

1 个答案:

答案 0 :(得分:0)

在控制器端,“ DataSourceRequest”以不同的方式映射了表单值(例如,检查前端发送的“过滤器”而不是“过滤器”作为参数的POST请求。我必须创建一个新模型类来绑定适当的值