【问题标题】:KendoUI TreeView trying to add dirty property to Poco and getting Uncaught TypeError: e.slice is not a functionKendo UI TreeView 试图向 Poco 添加脏属性并得到 Uncaught TypeError: e.slice is not a function
【发布时间】:2016-03-22 22:02:48
【问题描述】:

好的,所以在 Kendo UI 树视图上,我正在尝试将一个属性添加到我的 c# poco 中,但是一旦我这样做了,我就会在 错误 strong>chrome 开发工具

未捕获的类型错误:e.slice 不是函数

我正在阅读有关添加到模型的信息,所以我添加了 dirty:"dirty"

schema: {
     model: {
       id: "Id", 
       dirty: "dirty",
       hasChildren: "Id"
     }
}

然后添加了导致问题的 C# poco 属性

public bool dirty { get; set; }

我首先想要dirty属性的原因是因为我没有使用kendo sync()方法,当我吐出数据源时我看到了

console.log(mydatasource.data());

然后我看到“dirty”在数组中。

我已经为 children 做了同样的事情,无论我是否扩展树视图(只有在扩展节点时才具有子级,因为它调用 mvc 控制器方法)

// my children nodes
public List<Students> items { get; set; }

items 在生成的 array 中,不会导致任何问题..

为什么“”是个问题?

【问题讨论】:

  • 尝试将此属性设置为架构:parse: function(data) { if (!data) { data = []; } return data; }

标签: javascript c# kendo-ui treeview kendo-treeview


【解决方案1】:

好吧,我不使用dirty,因为那不是必需的或好主意。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2014-09-09
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多