简体   繁体   English

Extjs 5行编辑仅在某些情况下

[英]Extjs 5 rowediting only in some conditions

Good day all, I have a table in which I use the rowediting feature, and I have this column: 一切顺利,我有一个使用行编辑功能的表,并且此列:

{
  text: 'CPL Object',
  dataIndex: 'CPLObj',
  flex: 1,
  editor: {
           allowBlank: false
   }

} }

now, I'd like to make this column editable, only if another column has a certain value, let's say if the 'model' column has 'CPU' as value. 现在,我想使此列可编辑,仅当另一列具有特定值时,假设'model'列具有'CPU'作为值。 Otherwise I'd like to Not have the editor for this value. 否则,我希望没有该值的编辑器。

Is that possible? 那可能吗?

do you mean your using grid? 您是说使用网格? Have you tried adding a formula on your viewModel for checking if the model column you wish to check do have a value? 您是否尝试过在viewModel上添加公式以检查您要检查的model列是否具有值? Maybe something like: 也许像这样:

Viewmodel:
   checkvalue: function(get){
     var x = true;
     if (get('current.model' !== ''){ 
        x = false 
     } 
     return x;
    }


   ViewController: (on your binding)
   column: {
     readonly: '{checkvalue}' 
   }

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM