Ext-radio动态加载——格式设置

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>radio auto add items</title>
    <meta name="Copyright" content="test"/>
    <meta name="Description" content="PM"/>
    <meta name="Version" content="0.0.1.20130621"/>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <link rel="stylesheet" href="../../../pm/css/ext-all-neptune-debug.css"/>
    <link rel="stylesheet" href="../../../pm/css/ext-cn.css"/>
    <script type="text/javascript" src="../../../../commons/extjs/script/ext-all.js"></script>
    <script type="text/javascript" src="../../../../commons/extjs/script/ext-lang-zh_CN.js"></script>
   
    <style type="text/css">
        .x-form-radio {
            position: absolute;
        }
        .x-form-cb-label-after {
            margin: 5px 0px 0px 10px;
            margin-left: 25px;
            width: 250px;
        }
        .x-form-cb-wrap {
            height: 24px;
            width: 300px;
        }
    </style>
</head>
<body>

</body>
</html>
var equRadio=Ext.create('Ext.form.RadioGroup',{
        id:'equRadio',
        hideLabel : true,
        // vertical: true,
        Horizontal:true,
        layout:'vbox',
        items:[
           /* { boxLabel: 'Item 1',id:'sbmcid',name: 'sbmc', inputValue: '1' },
            { boxLabel: 'Item 2',id:'sbmcid',name: 'sbmc', inputValue: '2', checked: true},
            { boxLabel: 'Item 3',id:'sbmcid',name: 'sbmc', inputValue: '3' }*/
        ]
    });
    var westPanel=Ext.create('Ext.panel.Panel',{
        id:'westPanel',
        layout:'vbox',
        width:'30%',
        /*frame:true,
        border:false,
        baseCls: 'my-panel-no-border',*/
        region:'west',
        items:[equRadio]
    });
    var equSiteRadio=Ext.create('Ext.form.RadioGroup',{
        id:'equSiteRadio',
        hideLabel : true,
        layout:'vbox',
        items:[]
    });
    var centerPanel=Ext.create('Ext.panel.Panel',{
        id:'centerPanel',
        layout:'vbox',
        width:'30%',
        region:'center',
        /*frame:true,
        border:false,
        baseCls: 'my-panel-no-border',*/
        items:[equSiteRadio]
    });
Ext.data.StoreManager.lookup('sbmcStore').on('load', function (store, records) {
        // Ext.getCmp("sbmc").select(Ext.data.StoreManager.lookup('sbmcStore').getAt(0));
        // Ext.getCmp("mainequsite").setText("主设备位置:"+Ext.data.StoreManager.lookup('sbmcStore').data.items[0].get("V_EQUSITENAME"));

        if(records.length>0){
            var redios=[];
            for(var i=0;i<records.length;i++){
                if(i==0){
                    Ext.ComponentManager.get("equRadio").add({
                        checked : true,
                        boxLabel : records[0].get("V_EQUNAME"),
                        name : "sbmc",
                        // width:'300',
                        // labelWidth:'280',
                        inputValue : records[0].get("V_EQUCODE")
                    });
                    Ext.ComponentManager.get("equSiteRadio").add({
                        checked : true,
                        boxLabel : records[0].get("V_EQUSITENAME"),
                        name : "sbmc",
                        // width:'300',
                        // labelWidth:'280',
                        inputValue : records[0].get("V_EQUSITE")
                    });
                }else{
                    Ext.ComponentManager.get("equRadio").add({
                        boxLabel : records[i].get("V_EQUNAME"),
                        name : "sbmc",
                        inputValue : records[i].get("V_EQUCODE")
                    });
                    Ext.ComponentManager.get("equSiteRadio").add({
                        boxLabel : records[i].get("V_EQUSITENAME"),
                        name : "sbmc",
                        inputValue : records[i].get("V_EQUSITE")
                    });
                }
            }
        }

       /* Ext.ComponentManager.get("equRadio").add({
            checked : true,
            id:'sbmcid',
            boxLabel : '1',//records.data[0].get("V_EQUNAME"),
            name : "sbmc",
            inputValue :'10'//records.data[0].get("V_EQUCODE")
        });*/
        Ext.data.StoreManager.lookup('childEquStore').load({
            params: {
                V_V_PERSONCODE: V_V_PERSONCODE,
                V_V_DEPTCODE: Ext.getCmp('ck').getValue(),
                V_V_DEPTNEXTCODE: Ext.getCmp('zyq').getValue(),
                V_V_EQUTYPECODE: Ext.getCmp('sblx').getValue(),
                V_V_EQUCODE: Ext.getCmp('equRadio').getChecked().inputValue
            }
        });
        // Ext.ComponentManager.get("westPanel").items.add({});
        // Ext.getCmp('cpanel').show();
        // Ext.getCmp('sgrid').getView().refresh()
    });

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值