ExtJs6级联combo的实现

父类获取子类进行操作

    {
            xtype: 'combo',
            store: Common.Dic.getDicData("IMAGE_BIG_TYPE") ,
            multiSelect: false,
            valueField: 'dictionaryText',
            displayField: 'dictionaryText',
            name: 'bigType',
            fieldLabel: '一级分类',
            emptyText: '一级分类',
            allowBlank:false,
            listeners : {select : function(combo, record, index) {
                    var spaceCombo=Ext.getCmp('customerF').form.findField('space');
                    var spaceStore = spaceCombo.store;
                    spaceCombo.clearValue();
                    spaceStore.reload({
                        params : {
                            typeName : record.get('dictionaryText')
                        }
                    });
                    spaceCombo.expand();
                }
            }
        } ,{
            xtype: 'combo',
            store :Ext.create('Ext.data.Store', {
                model: 'dictionary.Dictionary',
                proxy: {
                    type: 'ajax',
                    extraParams:{
                        type:0
                    },
                    url: Common.Config.requestPath('Dictionary' , 'getDictionaryByType'),
                    reader: {
                        type: 'json',
                        rootProperty: 'data'
                    }
                }
            }),
            multiSelect: true,
            valueField: 'dictionaryText',
            displayField: 'dictionaryText',
            name: 'space',
            fieldLabel: '空间(功能)',
            emptyText: '请选择空间(功能)',
            allowBlank:false
        }

 

posted @ 2017-11-13 10:36  Rest探路者  阅读(500)  评论(0编辑  收藏  举报
levels of contents