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') ;
});