这是我的架构:
id: 'EntryCode',
fields: {
EntryCode: {editable: true, validation: {required: true}, nullable: true},
width: {editable: true, validation: {required: true}, nullable: true},
length: {editable: true, validation: {required: true}, nullable: true}
}
我希望 EntryCode 仅在创建选项中可编辑,而在更新选项中则不可编辑。
如果没有模板,我如何实现这个目标?
最佳答案
因为我使用的是editable: inline,所以我必须找到该单元格并替换其内容,如下所示:
edit: function (e) {
if (!e.model.isNew()) {
e.container.find('td:eq(0)').text(e.model.EntryCode);
}
}
要了解更多信息,请参阅此 question .
关于javascript - 剑道网格 "editable false"用于更新, "editable true"用于创建,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21042978/