【问题标题】:Grid.columns.editable not available where is wrong?Grid.columns.editable not available 哪里错了?
【发布时间】:2017-02-21 07:05:20
【问题描述】:

我在使用 popup 编辑时遇到了 kendoGrid 问题。即使我将可编辑属性设置为 false,它也会在弹出窗口中将第一列的值显示为标签。

columns: [
    {
        template: kendo.template('<span>#: sys_index # </span>'),
        width: 38,
        editable: false
    }, {
        title: 'System Name',
        field: 'SystemName'
    }, {
        command: ['edit', 'destroy'], width: 200
    }
]

rendered grid

grid popup

【问题讨论】:

  • 欢迎来到stackoverflow。我重新起草了您的问题以澄清您的问题。如果网格弹出窗口中不必要的标签不是您的问题,请对其进行编辑并说明您的问题。

标签: kendo-ui kendo-grid


【解决方案1】:

可编辑性决定了字段值是否可以修改,但在这两种情况下仍会出现。一个可能的选择是删除 Grid 的 edit 事件中的只读内容。

http://docs.telerik.com/kendo-ui/api/javascript/ui/grid#events-edit

http://dojo.telerik.com/ItUvA

假设只读内容在第一列...

edit: function(e) {
    var form = e.container;
    form.find(".k-edit-label").eq(0).remove();
    form.find(".k-edit-field").eq(0).remove();
}

【讨论】:

    猜你喜欢
    • 2015-02-16
    • 2018-01-21
    • 1970-01-01
    • 1970-01-01
    • 2022-11-11
    • 1970-01-01
    • 2011-04-02
    • 1970-01-01
    相关资源
    最近更新 更多