2012-12-10 75 views

回答

1

如果只能使用行編輯器進行編輯,則不要在該列上指定編輯器配置。 如果你可以添加太多,那麼你可以試試下面的(我還沒有做過它自己,但它應該工作):

grid.on('beforeedit', function(editor, e, eOpts) { 
    // if editing.. 
    this.down('column[dataIndex=name]').setEditor(null); 
    // else 
    this.down('column[dataIndex=name]').setEditor(/* editor config */); 
}, grid); 
0

您可以使用此

grid.on('beforeedit', function(editor, e, eOpts) { 
     // if editing.. 
     if(e.field == "name"){ 
       e.cancel = true; 
      } 
    }); 

中設定e。取消爲true將禁用該字段進行編輯。