【问题标题】:Kendo Grid Server Side filtering sending null as a filter object to the backendKendo Grid 服务器端过滤将 null 作为过滤器对象发送到后端
【发布时间】:2018-09-18 12:49:01
【问题描述】:

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

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,但它对我没有帮助,因为我无法复制列为已接受答案的解决方案

【问题讨论】:

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


    【解决方案1】:

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

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2022-10-17
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2018-08-15
      • 2021-02-25
      相关资源
      最近更新 更多