extjs 如何获取combox下拉框中选中的值

extjs 如何获取combox下拉框中选中的值,第1张

var securityTypeIDValue = ExtgetCmp('securityTypeCombo')getValue();

// 获取显示值

var securityTypeDisValue = ExtgetCmp('securityTypeCombo')getRawValue(); 

// Combox定义

/Combox start/

var securityTypeRecord=[   

                    {name : 'SAVE_VALUE',type : 'string'},   

                    {name : 'DISPLAY_VALUE',type : 'string'}

            ];     

var securityTypeRecordHeads = ExtdataRecordcreate(securityTypeRecord); 

var securityTypeDatastore = new ExtdataStore( {   

    proxy:new Extdata>

readOnly : true 可以的亲自试过,下面是我测试的代码。

ExtonReady(function() {

var FieldContainer = Extcreate('ExtformFieldContainer', {

    items : [{

        xtype : 'fieldcontainer',

        layout : 'hbox',

        fieldLabel : 'Size',

        defaults : {

            flex : 1

        },

        defaultType : 'radiofield',

        items : [{

            boxLabel : 'M',

            name : 'size',

            inputValue : 'm',

            readOnly : true,

            id : 'radio1'

        }, {

            boxLabel : 'L',

            name : 'size',

            inputValue : 'l',

            readOnly : true,

            id : 'radio2'

        }, {

            boxLabel : 'XL',

            name : 'size',

            inputValue : 'xl',

            readOnly : true,

            id : 'radio3'

        }]

    }]

});

Extcreate('ExtcontainerViewport', {

    layout : 'vbox',

        items : [FieldContainer]

    });

});

如果你的 readOnly 没起作用,就说明写错地方了。要不发一下你的代码。

Extjs中 我先从后台获取到数据存储到一个jsonStore 但是再前台还要往里面//定义类型,注意和你json返回的记录格式要一致 var MyRecordType = ExtExtjs里面的html中的id后台怎么获取

如果在formPanel中使用了checkBox,radioBox时,在提交表单时使用formPanelgetForm()submit()来提交数据时,如果单选框和复选框未选中时,则extjs是不会提交这些控件的。在postdata中根本就不存在这些控件的任何影子。可以通过firebug来查看提交的数据。

首先获取下拉框的值ExtgetCmp("q_jg")getValue(),这步应该没问题吧

然后,调用以下方法,进行替换。我这是性别的例子,楼主对照这改改就好

function gridUserType(value) {

var inx = sexStoregetCount();

for ( var i = 0; i < inx; i++) {

var rec = sexStoregetAt(i);

if (recget("id") == value) {

return recget("name");

}

}

}

以上就是关于extjs 如何获取combox下拉框中选中的值全部的内容,包括:extjs 如何获取combox下拉框中选中的值、ExtJS 如何在页面获取当前行某一列的值,并将该列值从0改为1、extJs单选框(radio)如何设置为不可编辑等相关内容解答,如果想了解更多相关内容,可以关注我们,你们的支持是我们更新的动力!

欢迎分享,转载请注明来源:内存溢出

原文地址:https://54852.com/web/9574421.html

(0)
打赏 微信扫一扫微信扫一扫 支付宝扫一扫支付宝扫一扫
上一篇 2023-04-29
下一篇2023-04-29

发表评论

登录后才能评论

评论列表(0条)

    保存