Disable editing in kendo grid

后端 未结 5 855
臣服心动
臣服心动 2021-01-19 07:26

I am trying make the an editable grid to uneditable depend on conditions.

I have tried in jquery as below

var $grid = &(\"#gridName\").data(\"ken         


        
5条回答
  •  借酒劲吻你
    2021-01-19 08:22

    If you're using "incell" edit mode, the grid has an "edit" event you could use to immediately close the cell.

    $("#grid").kendoGrid({
    
      ...
    
      edit: function(e) {
          if ( ... ) {
              this.closeCell();
          }
      }
    
      ...
    
    });
    

    A more powerful approach would be to subclass the kendoGrid and override the editCell and/or editRow methods. Then you can do whatever you want. Look here for info on subclassing kendo widgets.

提交回复
热议问题