ext中viewport布局问题

zsrui 2008-07-21 02:46:00
我想用ext在页面中排列几个小方块,然后每个小方块显示一个新闻栏目的内容标题,现在用到viewport做布局,其中html属性只允许设置静态内容,我不知道怎么在每个小方块中引入外部程序,伪代码大概是SETURL:'title.jsp'的意思,请指点下

现有代码如下:

Ext.onReady(function(){

Ext.state.Manager.setProvider(new Ext.state.CookieProvider());

// create some portlet tools using built in Ext tool ids
var tools = [
/*{
id:'gear',
handler: function(){
Ext.Msg.alert('Message', 'The Settings tool was clicked.');
}
},{
id:'close',
handler: function(e, target, panel){
panel.ownerCt.remove(panel, true);
}
}*/
];

var viewport = new Ext.Viewport({
layout:'border',
items:[{
xtype:'portal',
region:'center',
margins:'35 5 5 0',
items:[{
columnWidth:.33,
style:'padding:10px 0 10px 10px',
items:[{
title: 'a',
layout:'fit',
tools: tools,
items: new SampleGrid([0, 2, 3])
},{
title: 'a1',
tools: tools,
html: Ext.example.shortBogusMarkup
},{
title: 'a2',
tools: tools,
html: Ext.example.shortBogusMarkup
}]
},{
columnWidth:.33,
style:'padding:10px 0 10px 10px',
items:[{
title: 'b',
tools: tools,
html: Ext.example.shortBogusMarkup
},{
title: 'b1',
tools: tools,
html: Ext.example.shortBogusMarkup
}]
},{
columnWidth:.33,
style:'padding:10px',
items:[{
title: 'Panel 3',
tools: tools,
html: Ext.example.shortBogusMarkup
},{
//id = 'iwant',
title: 'Panel 5',
tools: tools,
//html: Ext.example.shortBogusMarkup,
URL:'b.html' //这个写上了,但是没起作用
}]
}]
}]
});
//var nn = getEl('iwant') ;
});

...全文
261 4 打赏 收藏 转发到动态 举报
写回复
用AI写文章
4 条回复
切换为时间正序
请发表友善的回复…
发表回复
ad是发生的发 2009-06-01
  • 打赏
  • 举报
回复
受教了. 本来也为难了好长时间的.
zsrui 2008-07-22
  • 打赏
  • 举报
回复
autoLoad是在【items】里面写吗?我再api里没看到用法。

能否告知具体代码?
zsrui 2008-07-22
  • 打赏
  • 举报
回复

增加
autoLoad:{url:'b.html'}
问题解决

leadergg 2008-07-21
  • 打赏
  • 举报
回复
第一个方法,在HTML里面用ifame

第二个方法:你可以用 autoLoad 属性 来实现

87,904

社区成员

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

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