1>.页面内容:Grid中有两列,两列里都是combobox。2>.页面初始化时:第一列combobox,是可用的。
第二列combobox,是不可用的。注:grid记录数 > 13>.问题:比如:在第三行第一列选择combobox后,第二列中的combobox变成可用。
第二列其他combobox还是不好用。求方法。。

解决方案 »

  1.   


    listeners:{
     'select': function(){
    alert('test')
        }
     }添加第一个combobox的监听   改变第二个combobox editable:false
      

  2.   

    看描述应该是当前行第一列选择后第二列放开编辑?
    应该是使用grid的编辑插件吧?那么可以监听其beforeedit事件,判断当前record第一列中是否有值,判断第二列是否可以编辑,
    由于我这没有环境,稍等我用笔记本给你写个例子...
      

  3.   

    由于没有ide,我在ext网上的api写的,大概看一下吧,如果readonly不满足可以disabledExt.create('Ext.data.Store', {
        storeId:'simpsonsStore',
        fields:['name', 'email', 'phone'],
        data:{'items':[
            {"name":"Lisa", "email":"[email protected]", "phone":"555-111-1224"},
            {"name":"Bart", "email":"[email protected]", "phone":"555-222-1234"},
            {"name":"Homer", "email":"[email protected]", "phone":"555-222-1244"},
            {"name":"Marge", "email":"[email protected]", "phone":"555-222-1254"}
        ]},
        proxy: {
            type: 'memory',
            reader: {
                type: 'json',
                root: 'items'
            }
        }
    });Ext.create('Ext.grid.Panel', {
        title: 'Simpsons',
        store: Ext.data.StoreManager.lookup('simpsonsStore'),
        listeners:{
            beforeedit:function(editor,e){
                if(e.field == 'email'){
                        if(e.record.get('name')!=''){
                            e.column.field.setReadOnly(false)
                        }else{
                             e.column.field.setReadOnly(true)
                        }
                }
            }
        },
        columns: [
            {header: 'Name',  dataIndex: 'name', editor: 'textfield'},
            {header: 'Email', dataIndex: 'email', flex:1,
                editor: {
                    xtype: 'textfield',
                    allowBlank: false
                }
            },
            {header: 'Phone', dataIndex: 'phone'}
        ],
        selType: 'cellmodel',
        plugins: [
            Ext.create('Ext.grid.plugin.CellEditing', {
                clicksToEdit: 1
            })
        ],
        height: 200,
        width: 400,
        renderTo: Ext.getBody()
    });