goangus
22 Dec 2011, 7:37 AM
Hi there,
I am trying to setup a tabPanel. On the first card, i have a number of buttons and I want to display various cards on the click of each button i.e. :
App.views.ViewportActive = Ext.extend(Ext.TabPanel, {
id: "mainViewport", fullscreen: true,
defaults: {
scroll: 'vertical',
},
initComponent: function() {
this.items = [{
xtype: 'panel',
title: 'My profile',
items: {xtype: 'App.views.MyPanel}
},{
panel2....
},{
panel3....
}
App.views.MyPanel = Ext.extend(Ext.Panel, {
initComponent: function() {
this.layout = 'card';
this.home = new Ext.Panel({
id: 'home',
layout: {type: "vbox", align: 'stretch', pack:'start'},
items: [{
xtype: "panel",
layout: 'card',
html: "Blah Blah"
},{
xtype: 'panel',
layout: {type: 'vbox'},
defaults: {xtype: 'button'},
items: [
{text: info', handler: function(){
App.views.viewport.backButton.show()
myPanel.setActiveItem('infoPage', {type: 'slide', direction: 'left'})
}},
]
}]
})
this.infoPage = new Ext.Panel({
id: "infoPage",
html: "Blah Blah.....",
});
this.items = [this.home, this.infoPage]
This seems to work if i set both the tabPanel and the "MyPanel" to
fullscreen: true, however the fullscreen attribute sets the height of "MyPanel" to the height of the viewport so I lose some of the content if it is taller than the viewport. If i dont set fullscreen, the content isn't rendered at all. Is it possible to have a panel with a card layout inside a tabPanel?
Thanks for any help
Paul
I am trying to setup a tabPanel. On the first card, i have a number of buttons and I want to display various cards on the click of each button i.e. :
App.views.ViewportActive = Ext.extend(Ext.TabPanel, {
id: "mainViewport", fullscreen: true,
defaults: {
scroll: 'vertical',
},
initComponent: function() {
this.items = [{
xtype: 'panel',
title: 'My profile',
items: {xtype: 'App.views.MyPanel}
},{
panel2....
},{
panel3....
}
App.views.MyPanel = Ext.extend(Ext.Panel, {
initComponent: function() {
this.layout = 'card';
this.home = new Ext.Panel({
id: 'home',
layout: {type: "vbox", align: 'stretch', pack:'start'},
items: [{
xtype: "panel",
layout: 'card',
html: "Blah Blah"
},{
xtype: 'panel',
layout: {type: 'vbox'},
defaults: {xtype: 'button'},
items: [
{text: info', handler: function(){
App.views.viewport.backButton.show()
myPanel.setActiveItem('infoPage', {type: 'slide', direction: 'left'})
}},
]
}]
})
this.infoPage = new Ext.Panel({
id: "infoPage",
html: "Blah Blah.....",
});
this.items = [this.home, this.infoPage]
This seems to work if i set both the tabPanel and the "MyPanel" to
fullscreen: true, however the fullscreen attribute sets the height of "MyPanel" to the height of the viewport so I lose some of the content if it is taller than the viewport. If i dont set fullscreen, the content isn't rendered at all. Is it possible to have a panel with a card layout inside a tabPanel?
Thanks for any help
Paul