`
Althars
  • 浏览: 75132 次
  • 性别: Icon_minigender_1
  • 来自: 成都
文章分类
社区版块
存档分类

EXT 多个radio 横向排列

EXT 
阅读更多

项目中用到radio,横向排了2个一切正常,排了4个就完全混乱,baidu了一下,用 layout:'column',  layout: 'form', 混合用来解决

//各个输入项
    var panelItem=  [

    		       {
                    		columnWidth:1,
                			layout: 'form',
                			items:[{
	                    		xtype:'hidden',
			                    fieldLabel: '编号',
			                    id:'id',
			                    name: 'Obj.id',
			                    readOnly:true,
			                    hidden:false,
			                    width: 100,
			                    maxLength:10,
			                    minLength:1,
			                    allowBlank: false
                    			}]

	                    },
	              {
                    		columnWidth:1,
                			layout: 'form',
                			items:[{
                			    xtype:'hidden',
			                    fieldLabel: '父节点id',
			                    id:'pId',
			                    msgTarget:'under',
			                    name: 'Obj.base.id',//避免冲突
			                    height:22,
width:180,
			                    readOnly:true,
			                    maxLength:20,
			                    allowBlank: true }
                    			]

	                    },
    		    {
                    layout:'column',
                    items:[
                    	{
                    		columnWidth:.5,
                			layout: 'form',
                			items:[{
	                    		xtype:'textfield',
                                fieldLabel: '父节点',
			                    id:'parentName',
			                    hidden:false,
			                    readOnly:true,
			                    name: 'parentName', //此项只为显示
			                    height:22,
                                width:180,
			                    minLength:1
                    			}]

	                    },
	                    {
	                    	columnWidth:.5,
                			layout: 'form',
                			items:[{xtype:'textfield',
			                    fieldLabel: '名   称',
			                    id:'name',
			                    msgTarget:'under',
			                    name: 'Obj.name',
			                    height:22,
                                width:180,
			                    maxLength:20,
			                    allowBlank: false }]
	                    },



	                    	                     {
 	columnWidth:.5,
                 layout:'column',
                 items:[
                       {
                       	columnWidth:.5,
                         layout: 'form',
                         items: [new Ext.form.Radio({style:'margin-top:5px',
                         fieldLabel: '长   度',
                         id:'length1',
			                    			boxLabel:'有',
							                name: 'Obj.length',
							                inputValue:1,
							                checked:false})]
                     },

                     {
                     	columnWidth:.5,

                     	items: [new Ext.form.Radio({style:'margin-top:5px',
                     id:'length2',
			                    			boxLabel:'无',
							                name: 'Obj.length',
							                inputValue:0,
							                checked:true})]
                     }
                     ]
             },



	                     {
 	columnWidth:.5,
                 layout:'column',
                 items:[
                       {
                       	columnWidth:.5,
                         layout: 'form',
                         items: [new Ext.form.Radio({style:'margin-top:5px',
                         fieldLabel: '宽   度',
                         id:'width1',
			                    			boxLabel:'有',
							                name: 'Obj.width',
							                inputValue:1,
							                checked:false})]
                     },

                     {columnWidth:.5,
                     items: [new Ext.form.Radio({style:'margin-top:5px',
                     id:'width2',
			                    			boxLabel:'无',
							                name: 'Obj.width',
							                inputValue:0,
							                checked:true})]
                     }
                     ]
             },



 {
 	columnWidth:.5,
                 layout:'column',
                 items:[
                       {
                       	columnWidth:.5,
                         layout: 'form',
                         items: [new Ext.form.Radio({style:'margin-top:5px',
                         fieldLabel: '高   度',
                         id:'height1',
			                    			boxLabel:'有',
							                name: 'Obj.height',
							                inputValue:1,
							                checked:false})]
                     },

                     {
                     	columnWidth:.5,
                     	items: [new Ext.form.Radio({style:'margin-top:5px',
                     id:'height2',
			                    			boxLabel:'无',
							                name: 'Obj.height',
							                inputValue:0,
							                checked:true})]
                     }
                     ]
             },

 {
 	columnWidth:.5,
                 layout:'column',
                 items:[
                       {
                       	columnWidth:.5,
                         layout: 'form',
                         items: [new Ext.form.Radio({style:'margin-top:5px',
                         fieldLabel: '体   积',
                         id:'volume1',
			                    			boxLabel:'有',
							                name: 'Obj.volume',
							                inputValue:1,
							                checked:false})]
                     },

                     {
                     	columnWidth:.5,
                     items: [new Ext.form.Radio({style:'margin-top:5px',
                     id:'volume2',
			                    			boxLabel:'无',
							                name: 'Obj.volume',
							                inputValue:0,
							                checked:true})]
                     }
                     ]
             },



	                     {
	                    	columnWidth:.5,
                			layout: 'form',
                			items:[{xtype:'textfield',
			                    fieldLabel: '备   注',
			                    id:'descn',
			                    msgTarget:'under',
			                    name: 'Obj.descn',
			                    height:22,
                                width:180,
			                    maxLength:20,
			                    allowBlank: true }]
	                    }
	                   ]
                }


                ];

	//form
    var panel = new Ext.FormPanel({
        applyTo: 'Content-render-panel-div',
        frame:true,
        url:'saveOrUpdateBase.action',
        //reader:thospital,
        autoHeight:true,
        autoWidth:true,
        autoScroll:true,
        items:panelItem ,
		buttons: [{
            text: '保存',
            id:'hsubmit',
            handler:save
        }]
 
  • 大小: 9.3 KB
分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics