+ -
当前位置:首页 → 问答吧 → Ext formpanel的问题,急急急

Ext formpanel的问题,急急急

时间:2011-09-05

来源:互联网

我要生成一个页面,效果就是排成两列,但使用如下代码生成出来的却是如下图的效果,只有一行,连label都没有,请问是哪儿有问题,代码:
JScript code
var formPanel = new Ext.form.FormPanel({
            id: 'ndjhform',
            xtype: 'fieldset',
            //plain: true,
            layout: "column",
            defaultType: "textfield",
            labelWidth: 85,
            baseCls: "x-plain",
            //锚点布局-
            defaults: { anchor: "95%", msgTarget: "side" },
            buttonAlign: "center",
            bodyStyle: "padding:0 0 0 0",
            items: [{
//                buttonAlign: "center",
//                layout : 'column', 
//                bodyStyle : 'background:transparent', 
//                border : false, 
//                items: [{
                        columnWidth: .5,
                         layout: 'form',
                         bodyStyle: 'background:transparent',
                         border: false,
                         items: [
                               this.begindDate,
                               this.dwbmCombobox,
                               this.xxtsText,
                               this.dwbmText,
                               this.zbbmText
                        ]
                        },{
                            columnWidth: .5,
                             layout: 'form',
                             bodyStyle: 'background:transparent',
                             border: false,
                             items: [
                                   this.endDate,
                                   this.zbbmCombobox,
                                   this.zbbmgrid,
                                   this.dwmcText,
                                   this.IDText
                            ]
                        //}]
                }]
        });

        return formPanel;
    },

生成效果如下

作者: doyouknowm   发布时间: 2011-09-05

是跟layout有关还是其他的原因呢

作者: doyouknowm   发布时间: 2011-09-05

LZ将第5行的
layout: "column",
改成
layout: "form",
试试

作者: wyx177694333   发布时间: 2011-09-05

怎么没有人呢,都在忙吗

作者: doyouknowm   发布时间: 2011-09-05

LZ你的第13~18行的不能注释掉啊..那表示的时按column(行)排列,也就是其中所有的items占一行

作者: wyx177694333   发布时间: 2011-09-05

引用 2 楼 wyx177694333 的回复:

LZ将第5行的
layout: "column",
改成
layout: "form",
试试

不行,试了

作者: doyouknowm   发布时间: 2011-09-05

引用 4 楼 wyx177694333 的回复:

LZ你的第13~18行的不能注释掉啊..那表示的时按column(行)排列,也就是其中所有的items占一行

因为加上了也不管用,所以就注释掉了

作者: doyouknowm   发布时间: 2011-09-05

bodyBorder: false,
  frame: true,
  fileUpload:true,
  style:'padding:1px',
  items: [
  {
  xtype: 'fieldset',
  labelWidth: 115,
  title:this.processeDetailText,
  layout:'form',
  collapsible: true,
  labelAlign : "left",
  autoHeight: true,
  items: [
  {
  // 第一行
  layout : "column",
  items: 
  [{
  columnWidth : .5,
  layout : "form",
  items: 
  [{
fieldLabel: this.barcodeidText,
name: '',
xtype: 'textfield',
allowBlank:false,
}]
  },
  {
  columnWidth : .5,
  layout : "form",
  items: 
  [{
fieldLabel: this.sampleNameText,
name: '',
xtype: 'textfield',
allowBlank:false,
readOnly:true  
}]
}]
  },{
  // 第二行
  layout : "column",
  items: 
  [{
  columnWidth : .5,
  layout : "form",
  items: 
  [{
fieldLabel: ,
name: '',
xtype: 'textfield',
allowBlank:false
}]
  },
  {
  columnWidth : .5,
  layout : "form",
  items: 
  [
new Ext.form.ComboBox({})
  ]
  }]
  },{
  // 第三行
  layout : "column",
  items: 
  [{
  columnWidth : .5,
  layout : "form",
  items: 
  [
  new Ext.form.ComboBox({})
  ]
  },
  {
  columnWidth : .5,
  layout : "form",
  items: 
  [{
fieldLabel: ,
name: '',
xtype: 'datefield',
format:'Y-m-d',
width: 127,
allowBlank:false
}]
  }]
  },{
  // 第四行
  layout : "column",
  items: 
  [{
  columnWidth : .5,
  layout : "form",
  items: 
  [{
fieldLabel: ,
name: '',
xtype: 'numberfield',
allowBlank:false,
readOnly: true
  }]
  },
  {
  columnWidth : .5,
  layout : "form",
  items: 
  [{
fieldLabel: ,
name: '',
xtype: 'numberfield',
regex: /^[0-9]+([.]{1}[0-9]{1,2})?$/,
regexText: this.errorNumber,
allowBlank: false,
readOnly: true
}]
  }]
  },{
  // 第五行
  layout : "column",
  items: 
  [{
  columnWidth : .5,
  layout : "form",
  items: 
  [{
fieldLabel: ,
name: '',
xtype: 'numberfield',
allowBlank:false,
readOnly: true
  }]
  },
  {
  columnWidth : .5,
  layout : "form",
  items: 
  [{
fieldLabel: ,
name: '',
xtype: 'textfield',
allowBlank:false,
regex: /(.*)(\.pdf)$/,
regexText: this.errorNumber,
readOnly:true
}]
  }]
  },{
  // 第六行
  layout : "column",
  items: 
  [{
  columnWidth : .5,
  layout : "form",
  items:  
  [
  new Ext.form.ComboBox({})
  ]
  },
  {
  columnWidth : .5,
  layout : "form",
  items: 
  [{
fieldLabel: ,
name: '',
xtype: 'textfield',
allowBlank:false
}]
  }]
  },{ 
  // 第七行
  layout : "column",
  items: 
  [{
  columnWidth : 1.,
  layout : "form",
  items: 
  [{
fieldLabel: ,
name: '',
xtype: 'textarea',
width: 452,
allowBlank:true
}]
  }]
  },{
  // hidden
  layout : "column",
  items: 
  [{ 
  columnWidth : 0,
  layout : "form",
  items: 
  [{
name: '',
xtype:'hidden',
allowBlank:false
}]
},
{
  columnWidth : 0,
  layout : "form",
  items: 
  [{
name: '',
xtype:'hidden',
allowBlank:false
}]
}]
  }]
  }]

lz先试试这个,关键地方自己补全哈

作者: wyx177694333   发布时间: 2011-09-05