Kendo UI grid conditionally editable cell

我与影子孤独终老i 提交于 2020-01-17 12:27:09

问题


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:


Try this

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


来源:https://stackoverflow.com/questions/28898845/kendo-ui-grid-conditionally-editable-cell

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!