EXTJS中选项卡的问题

javagongcheng 2012-02-23 04:40:22
1. 选项卡中嵌套一个表单 用 items 好像不可以
2. 选项卡的个数每次打开都一定 这个可以实现吗 ?
3. 还想给选项卡中的表单赋值 多条记录 不同的选项卡赋不同的值?

代码如下:

var tabs = new Ext.TabPanel({
id : 'tabs',
region : 'center',
activeTab : 0,
collapsed : true,
items : [{
id : 'Campaigins',
title : '选项卡1',
items: myForm
// html: '<input type="text" disabled="disabled" />'
// html : '<iframe scrolling="auto" frameborder="0" width="100%" height="100%" src="xttyqyManageCon.do"></iframe>'
}, {
id : 'Groups',
title : '选项卡2',
items: myForm
// html : ' <iframe scrolling="auto" frameborder="0" width="100%" height="100%" src="rqglManageCon.do"></iframe>'
}, {
id : 'Ads',
title : '选项卡3',
items: myForm
// html : ' <iframe scrolling="auto" frameborder="0" width="100%" height="100%" src="pljxManageCon.do"></iframe>'
}]
});

var tab = tabs.getItem('Campaigins') // 默认选项卡
...全文
323 4 打赏 收藏 转发到动态 举报
写回复
用AI写文章
4 条回复
切换为时间正序
请发表友善的回复…
发表回复
zyus1987 2012-02-24
  • 打赏
  • 举报
回复
{
id : "${uuid}flowTab",
xtype : "tabpanel",
items : [{
id : "${uuid}ext-gen2452",
xtype : "panel",
layout : "column",
title : "申请人",
items : [{
id : "${uuid}ext-gen3724",
width : "49%",
layout : "form",
border : false,
items : [{
id : "${uuid}ext-gen4494",
xtype : "textfield",
anchor : "98%",
fieldLabel : "申请人",
name : "submiter",
readOnly : true
},{
id : "${uuid}ext-gen5459",
xtype : "textfield",
anchor : "98%",
fieldLabel : "职位",
name : "jobTitle",
readOnly : true
},{
id : "${uuid}ext-gen6448",
xtype : "textfield",
anchor : "98%",
fieldLabel : "手机",
name : "mobile",
readOnly : true
}]
},{
id : "${uuid}ext-gen7745",
width : "49%",
layout : "form",
border : false,
items : [{
id : "${uuid}ext-gen8020",
xtype : "textfield",
anchor : "98%",
fieldLabel : "部门",
name : "department",
readOnly : true
},{
id : "${uuid}ext-gen9060",
xtype : "textfield",
anchor : "98%",
fieldLabel : "电话",
name : "phone",
readOnly : true
},{
id : "${uuid}ext-gen10128",
xtype : "textfield",
anchor : "98%",
fieldLabel : "E-mail",
name : "email",
readOnly : true
}]
}],
frame : false,
autoWidth : true,
bodyStyle : "padding:10px 10px 0"
},{
id : "${uuid}ext-gen13785",
xtype : "panel",
layout : "fit",
title : "附件",
items : [{
xtype : "attachmentgrid",
id : "${uuid}ext-gen14843",
autoHeight : false,
autoScroll : true,
hiddenName : "attachmentFkId",
fkId : "${id}",
border : false,
frame : false
}]
},{
id : "${uuid}flowLogPanel",
xtype : "panel",
title : "处理日志",
items : [{
xtype : "loggrid",
id : "${uuid}flowLog",
bpiId : "${id}"
}],
layout : "fit"
}],
height : 200,
activeTab : 0
}
javagongcheng 2012-02-24
  • 打赏
  • 举报
回复
[Quote=引用 1 楼 zyus1987 的回复:]
问题1:是可以使用items的,具体参考API
问题2:可以在TablePanel构建完成后使用add方法动态加入panel
问题3:每个标签页里面内容都是标签页自己控制的,可以是form表单,也可以是Grid表格,还可以是其他容器。加载内容也是独立的。
[/Quote]

有代码吗 ?
javagongcheng 2012-02-24
  • 打赏
  • 举报
回复
好吧 我承认我看不懂 我是新手 - -

现在我发现一个问题
因为选项卡是在一个窗口(window)中
当点击按钮 弹出这个窗口
我设置了选项卡的height
但是选项卡的高度还是为0
所以看不见选项卡里的内容
不知道这个是不是因为选项卡在一个窗口里的原因
zyus1987 2012-02-23
  • 打赏
  • 举报
回复
问题1:是可以使用items的,具体参考API
问题2:可以在TablePanel构建完成后使用add方法动态加入panel
问题3:每个标签页里面内容都是标签页自己控制的,可以是form表单,也可以是Grid表格,还可以是其他容器。加载内容也是独立的。

87,910

社区成员

发帖
与我相关
我的任务
社区描述
Web 开发 JavaScript
社区管理员
  • JavaScript
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧