PDA

View Full Version : Problem with panel expand/collapse in Viewport



DineshGudikandula
8 Jan 2013, 10:33 PM
Hi all...

In viewport west, center,south regions contain Panels.And center,south regions panels should show restore(in panel title bar) button.When user click on center regions panel restore button the west,south regions panels is collapsed properly and again click on restore button the west,south regions panels is expanded but these panels not showing any content(without content data).
And when i config like animCollapse:false it is showing fine.
My code is..


Ext.define('ST.view.Viewport', {
extend : 'Ext.container.Viewport',
requires: ['ST.view.Header','ST.view.TutorialsList','ST.view.StepsPanel','ST.view.PlaygroundPanel'],
layout: {
type: 'border',
regionWeights: {
west: 2,
north: 1,
south: -1,
east: -2
}
},
items : [{
xtype: 'pageheader',
region: 'north'
}, {
xtype : 'tutorialslist',
region: 'west',
split: true,
collapsible: true,
width: 250,
collapsible : false,
weight: 1,
stateful: true,
stateId: 'tutorialslistStateId',
}, {
xtype: 'stepspanel',
region: 'center',
tools:[{
type:'restore',
handler: function(event, toolEl, panel){

var playgroundpanel = Ext.ComponentQuery.query('playgroundpanel')[0];
var tutorialslist = Ext.ComponentQuery.query('tutorialslist')[0];
playgroundpanelstatus = playgroundpanel.getState();
playgroundpanel.toggleCollapse();
tutorialslist.toggleCollapse();
}
}]
}, {
xtype: 'playgroundpanel',
region: 'south',
title: 'Playground',
collapsible : false,
split: true,
collapsible: true,
stateful: true,
stateId: 'playgroundpanelStateId',
height: 350,
}]
});


How can i solve this problem..?
Thanks in advance..

DineshGudikandula
8 Jan 2013, 10:46 PM
Sorry in the above code i forgot to comment the collapsible : false,lines...

DineshGudikandula
8 Jan 2013, 11:56 PM
Hi...
And i have one more problem.Collapse is not working fine for Viewport center region panel.When user click on south regions panel restore button.That time i collapse the center,west regions panels pragmatically in restore button handler.It is collapse west panel properly but center panel collapsing and showing center panel header in center region full area,the south panel is not showing in full window.

It's argent plz...

friend
9 Jan 2013, 5:34 AM
The problem seems to be caused by toggleCollapse(). I changed the 'restore' handler to use collapse()/expand() and it works as expected:



if (playgroundpanel.getCollapsed() == false)
playgroundpanel.collapse();
else
playgroundpanel.expand();


One other issue I see is that your 'north' region has not been given a height or any content. This can also cause issues with expand/collapse.