EXT怎么在弹出窗口显示一个下拉框?

本文介绍如何使用ExtJS创建包含本地数据源的组合框,并通过实例展示了组合框的基本配置,包括字段设置、数据模式及触发动作等关键属性。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >


var cerficicationData [{

    'key' :'', 'value' :'全部'

}, {

    'key' :'0', 'value' :'无证'

}, {

    'key' :'1', 'value' :'有证'

}];

var cerficicationStore new Ext.data.SimpleStore( {

    fields name :'key', mapping :'key' }, name :'value', mapping :'value' ],

    data cerficicationData

});

 

 

 

var expBaseForm new Ext.FormPanel( {

        url :'',

        method :'post',

        labelAlign :'right',

        labelWidth :90,

        frame :true,

        bodyStyle :'padding:0px 0px 0',

        items: [{

                            id:'comboValue',

                            width:130,  //textfield默认的宽度                           

                            layout:'form',

                            fieldLabel:'是否有毕业证',

                            xtype:"combo",

                            valueField:"key",

                            displayField:"value",

                            hiddenName:"certificateFlag",

                            height:100,

                            width:200,

                            store:cerficicationStore,

                            mode 'local',//数据模式,local代表本地数据 

                            triggerAction 'all'// 显示所有下列数据,一定要设置属性triggerActionall 

        }]   

    });

 

var winIcsQuestionnaireData new Ext.Window( {

        layout 'fit',

        width 300,

        closeAction 'hide',

        height 200,

        closable false,

        resizable false,

        shadow true,

        modal true,

        closable true,

        bodyStyle 'padding:5 5',

        animCollapse true,

        items: expBaseForm,

       buttons [{

                                text :'确定',

                                handler function() {

                                alert(Ext.getCmp('comboValue').value());

                                }

                                },{

                                text:'关闭',

                                winIcsQuestionnaireData .hide();

                                }

                              }]

    });


================================================================================

================================================================================


var shareTypeCmbstores new Ext.data.SimpleStore({

                fields ['id', 'value'],

                data [['1', '数量'], ['2', '重量']]

            });

 

var shareTypeCmb new Ext.form.ComboBox({

                editable false,

                triggerAction 'all',

                fieldLabel '<font color="red">*</font>类型',

                store shareTypeCmbstores,

                displayField 'value',//显示下拉列表数据值

                valueField 'id', //提交时下拉列表框的数据值

                name 'type',

                mode 'local',

                anchor '90%',

                value '1',

                allowBlank false

            })

var okbtn new Ext.Button({

                text '确定',

                handler function() {

                     alert("值是 :"+shareTypeCmb.getValue()+"  显示值是:"+shareTypeCmb.getRawValue())

                }

            });

var nobtn new Ext.Button({

                text '关闭',

                handler function() {

                    insert_Win.close();

                }

            });

var insert_Win new Ext.Window({

                plain true,

                layout 'form',

                resizable false, // 改变大小

                draggable true, // 不允许拖动

                closeAction 'hide',// 可被关闭 close or hide

                modal true, // 模态窗口

                width 400,

                height 370,

                title '弹出窗口',

                items [shareTypeCmb],

                autoScroll true,

                buttonAlign 'center',

                loadMask true,

                tbar [okbtn, nobtn]

            });

    insert_Win.show();

}


评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值