Ext combo 드롭다운 상자 종속 연결

3031 단어 ext

 /******** start*****************/
    var storeProvince = new Ext.data.ArrayStore({
        fields : [
            'name', 'value'
        ],
        url:'queryProvince'
    });
    storeProvince.load();
    acceptManager_province = new Ext.form.ComboBox({
        renderTo :'province',
        store : storeProvince,          // 
        valueField : 'value',
        displayField : 'name',
        fieldLabel : ' ',
        typeAhead : true,
        mode : 'local',
        forceSelection : true,
        triggerAction : 'all',
        emptyText : '',
        selectOnFocus : true,
        width:100,
        tpl: '<tpl for="."><div ext:qtip="{name}" class="x-combo-list-item">{name}</div></tpl>',
        listeners: {
            'select': function(acceptManager_combo, record, index)
            {
                /* ID*/
                var proId = record.get('value');
                var dataSource = new Ext.data.HttpProxy({
                    method: 'POST',
                    url: 'queryCityPro'
                });
                acceptManager_storeCity.baseParams = {m_proId: proId};
                acceptManager_storeCity.proxy = dataSource;
                acceptManager_storeCity.load();
                acceptManager_city.clearValue();
                acceptManager_city.setValue("");
            }}
    });
    /******** end*****************/
    //var acceptManager_data = [[' ','1'],[' ','2'],[' ','3'],[' ','4'],[' ','5']];
    /******** start*****************/
    acceptManager_storeCity = new Ext.data.SimpleStore({
        fields: [
            "name","value"
        ],
        //proxy: new Ext.data.MemoryProxy(acceptManager_data)
        url:'queryCity'
    });
    acceptManager_storeCity.load();

    acceptManager_city = new Ext.form.MultiComboSearch({
        renderTo :'city',
        store:acceptManager_storeCity,
        valueField :"value",
        displayField: "name",
        labelSeparator:':',
        displaySeparator:',', // 
        valueSeparator:',',// 
        mode: 'local',
        value:'',
        forceSelection: true,
        hiddenName:'test',
        editable: false,
        triggerAction: 'all',
        emptyText:'',
        fieldLabel: ' ',
        width:100
    });
    /******** end*****************/

좋은 웹페이지 즐겨찾기