Kendo UI 网格条件可编辑单元格

Kendo UI grid conditionally editable cell

我正在尝试通过编写代码在 kendo 中执行有条件的可编辑单元格:

   edit: function (e) {                         
      var kendoTextBox = e.container.find("input[name=Ordertype]")[0];
      if (kendoTextBox)
        kendoTextBox.enable(e.model.RequestAmount == 0);
    },

当 RequestAmount 列为 0 时,ordertype 列应该是可编辑的,但事实并非如此。谁能告诉我哪里错了?

试试这个

edit: function (e) {
    var kendoTextBox = e.container.find("input[name=Ordertype]")[0];
    if (kendoTextBox && e.model.RequestAmount !== 0) 
        this.closeCell();
}