Kendo UI grid conditionally editable cell

2019-09-02 05:00发布

I am trying to do conditionally editable cells in kendo by writing code:

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

The ordertype column should be editable when RequestAmount column is 0, but is not. Can someone tell me where am I wrong?

1条回答
霸刀☆藐视天下
2楼-- · 2019-09-02 05:32

Try this

edit: function (e) {
    var kendoTextBox = e.container.find("input[name=Ordertype]")[0];
    if (kendoTextBox && e.model.RequestAmount !== 0) 
        this.closeCell();
}
查看更多
登录 后发表回答