【问题标题】:Critical Issue with Kendo UI Grid (post 2013 Q1 release)Kendo UI Grid 的严重问题(2013 年第一季度发布后)
【发布时间】:2013-08-20 16:37:21
【问题描述】:

看看这两个小提琴

http://jsfiddle.net/uFcHK/ (v2013.1.319)

http://jsfiddle.net/rcvY3/ (v2013.2.716)

代码相同。

var grid = $("#grid").kendoGrid({
    dataSource: {
        type: "odata",
        transport: {
            read: "http://demos.kendoui.com/service/Northwind.svc/Products"
        },
        pageSize: 15,
        serverPaging: true,
        serverSorting: true,
        serverFiltering: true
    },

    height: 450,
    sortable: true,
    pageable: true,
    editable: true,
    toolbar: ["create"],
    filterable: false,
    columns: ["ProductID", "ProductName", "UnitPrice"]
});

(你可以忽略损坏的导航面板,我在 prod 中看不到这个)

问题在于记录数。

如果您单击“添加新记录”,您将看到记录计数执行文本添加而不是数字添加。太疯狂了,不知道剑道怎么让这个滑了半年+

【问题讨论】:

  • 根据我的经验,Telerik 有不错的支持表格。听起来你需要在那里报告这个问题。
  • 您需要一个高级帐户才能在那里发帖。他们鼓励人们向 SO 发帖以获得免费支持。
  • 顺便说一句:样式的问题是因为您混合了不同版本的 KendoUI。您还使用了不受支持的 jQuery BUT 版本,这不是导致您的问题的原因。
  • 确实感谢 OnaBai。在 prod 中,我的一切都很好,但记录计数问题仍然存在。我无法将 kendo js 升级到 v2013.1.319 之后。我检查每个版本,希望他们能解决这个问题。但他们浑然不觉。
  • 问题似乎与odata有关。 Kendo UI 有一个服务返回与 JSONP 相同的数据,并且工作正常。

标签: kendo-ui kendo-grid kendo-mvvm


【解决方案1】:

问题在于ODatatotal 作为string 返回,因为这是作为string 接收的。

在以前的代码版本中,增量是作为total++ 完成的,但现在它被添加了number,允许在一个操作中添加多个记录。问题是,如果你这样做 string + number 你实际上得到了 number 连接到 string

解决它的最简单方法是提供一个total 函数,该函数只需将string 转换为number,就像在DataSource 中定义一样简单:

dataSource: {
    type           : "odata",
    transport      : {
        read: "http://demos.kendoui.com/service/Northwind.svc/Products"
    },
    schema : {
        total : function (data) {
            // Convert __count to number
            return +data.d.__count;
        }
    },
    pageSize       : 15,
    serverPaging   : true,
    serverSorting  : true,
    serverFiltering: true
},

【讨论】:

  • 伟大的工作奥纳拜。我希望剑道付钱给你修理他们的东西:)
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2017-07-23
  • 1970-01-01
  • 2017-05-30
  • 2015-09-08
  • 1970-01-01
相关资源
最近更新 更多