Extjs下拉框笔记



Ext.define("formTP",{

        extend:"Ext.data.Model",
        fields : [
            {name: 'tNFormTPId', type: 'long'},
            {name: 'fmTpName', type: 'string'}
        ]

    });     

                 

    var comboxStore = Ext.create("Ext.data.Store",{            
        model:"formTP",
        proxy:{
           type:"ajax",
           url:"createNewForm/createNewForm!viewFormTPData.action",
           reader: {type: 'json',root : "formTPList"}
        }

    });     

               

    comboxStore.load();


    var comboBox =  Ext.create('Ext.form.ComboBox', {
       store: comboxStore,
       valueField : "tNFormTPId",
       displayField : "fmTpName",
       mode : 'remote',
       forceSelection : true,// 必须选择一个选项
       editable : false,
       triggerAction : 'all',// 因为这个下拉是只能选择的,所以一定要设置属性triggerAction为all,不然当你选择了某个选项后,你的下拉将只会出现匹配选项值文本的选择项,其它选择项是不会再显示了,这样你就不能更改其它选项了。
       allowBlank : false,
       emptyText:"FormType Name",
       fieldLabel: 'FormType Name',
       name:"formTPId",
       margin: '5 10 5 10',
       width:422,
       labelWidth: 200

    });


评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值