Javascript 剑道网格字段值需要与显示的文本不同

Javascript 剑道网格字段值需要与显示的文本不同,javascript,kendo-ui,kendo-grid,Javascript,Kendo Ui,Kendo Grid,我在剑道中有一个网格,包含以下列: columns: [ { field: "GroupId", hidden: true}, { field: "Name", title: "Group Name"}, { field: "Description", title: "Description"}, { field: "Users.length", title: "Assigned Users" }] 数据源具有以下架构: schema: { model: { id:

我在剑道中有一个网格,包含以下列:

columns: [
{ field: "GroupId", hidden: true},
{ field: "Name", title: "Group Name"}, 
{ field: "Description", title: "Description"},
{ field: "Users.length", title: "Assigned Users" }]
数据源具有以下架构:

schema: {
    model: {
        id: "GroupId",
        fields: {
            Name: {editable: true},
            Description: {editable: true},
            Users: {editable: false},
        }
    }
}
我的问题是:我不希望用户是可编辑的,因此它具有editable:false属性。但这似乎没有绑定到我的Users.length字段

以下哪项是正确的/可实施的方法?我是剑道新手,所以我自己也没办法搞清楚

  • 我可以让字段名引用用户,并且显示值为Users.length吗
  • 我可以将架构中的字段绑定到Users.length吗
  • 将字段设置为您实际上甚至无法定义的任何字段(不是
    Users.length
    )。然后使用模板显示内容。比如:

    columns: [
        { field: "GroupId", hidden: true},
        { field: "Name", title: "Group Name"}, 
        { field: "Description", title: "Description"},
        { title: "Assigned Users", template: "#= Users.length #" }
    ]
    

    当您不定义
    字段
    属性时,该属性将自动变为不可编辑,但您仍然可以访问模型的字段。

    您希望显示文本为用户名的长度并为名称赋值??因此,如果名称为
    John
    display 4且
    John
    为值?!