PDA

View Full Version : Ext.Viewport border question



edwardking
9 Aug 2010, 10:08 PM
I use Ext.Viewport,like follows:


var viewport=new Ext.Viewport({
layout:'border',
items:[
new Ext.BoxComponent({
region:'north',
...
}),{
region:'south',
...
},{
region:'west',
...
},new Ext.TabPanel({
region:'center',
id:'center-panel',
......
})
...


I want to realize following function,there is a href,when click this href, the ''center' part will change another page,but other parts will still stay original page,like follows:
[CODE]
[URL=

Animal
9 Aug 2010, 11:40 PM
Why?

What kind of application does your boss want?

Because displaying google seems a little pointless.

edwardking
9 Aug 2010, 11:49 PM
Why?

What kind of application does your boss want?

Because displaying google seems a little pointless.

Oh, I only make a example, in fact, i redirect a jsp page,how to realize it?

[CODE]function test(){
Ext.getCmp('center-panel').location.href=

Animal
9 Aug 2010, 11:54 PM
You can throw some innerHTML Ajax-loaded from a JSP into a Panel. But it's pointless. You'll end up with a mess of dead HTML.

Add Ext Components to the TabPanel.

edwardking
9 Aug 2010, 11:56 PM
You can throw some innerHTML Ajax-loaded from a JSP into a Panel. But it's pointless. You'll end up with a mess of dead HTML.

Add Ext Components to the TabPanel.

Would you give me an example code?
Thanks in advance.

Animal
10 Aug 2010, 12:06 AM
Ass illustrated in example code, and in the API docs (if you READ them).

Simply create a Component (eg a FormPanel if that's what YOU want), and then add it to the TabPanel. Then tell the TabPanel that is the "active tab".

All simple and available from examples and the API docs.



var tp = Ext.getCmp("center-panel");
var newTab = new Ext.FormPanel({
title: 'A Form',
items: [{
xtype: 'textfield',
fieldLabel: 'A text field'
}],
buttons: [{
text: 'Submit'
}]
});
tp.add(newTab);
tp.setActiveTab(newTab);