日期:2014-05-16  浏览次数:20307 次

Ext两个Combobox值如何保持一致?
两个Combobox的值都一样,第一一个Combobox选择值后,提交,第二个Combobox默认选中第一个Combobox的值,请教如何搞定?
JScript code

Ext.onReady(function(){
    var form =new Ext.form.FormPanel({
        labelAlign:'right',
        title:'form',
        labelWidth:100,
        frame:true,
        width:300,
        items:[{
            xtype:"combo",
            id:'temp',
                 fieldLabel: '设备模板',
                 name: 'combo',
                 store: new Ext.data.SimpleStore({
                     fields: ['value', 'text'],
                     data: [
                         ['value1', 'SF气体泄漏报警系统'],
                         ['value2', '火灾报警器']
                     ]
                 }),
                 displayField: 'text',
                 valueField: 'value',
                 mode: 'local',
                 emptyText:'---请选择---'
        }],
        buttons:[{
            text:'提交',
            handler:function(){
                alert(Ext.getCmp('temp').getValue());
                form.getForm().submit({
                    success:function(form,action){
                        Ext.Msg.alert('信息',action.result.msg);
                    },
                    failure:function(){
                        Ext.Msg.alert('错误','操作失败');    
                    }
                });
            }
        }]
    });
    form.render("form");
    var form1 =new Ext.form.FormPanel({
        labelAlign:'right',
        title:'form',
        labelWidth:100,
        frame:true,
        width:300,
        items:[{
            xtype:"combo",
            id:'temp1',
                 fieldLabel: '设备模板',
                 name: 'combo',
                 store: new Ext.data.SimpleStore({
                     fields: ['value', 'text'],
                     data: [
                         ['value1', 'SF气体泄漏报警系统'],
                         ['value2', '火灾报警器']
                     ]
                 }),
                 displayField: 'text',
                 valueField: 'value',
                 mode: 'local',
                 emptyText:'---请选择---'
        }]
        });
    form1.render("form");
});



------解决方案--------------------
问题MS没解决 顶上去问问