PDA

View Full Version : Issue with Viewport West Region Expand / Collapse



awhiteho
30 Sep 2013, 8:02 AM
I've got an app with a viewport with a west region that, based on certain tabs I want to prevent from displaying. I was able to do this with a listener on the beforeexpand event.

When the expand button is clicked I set the return to false to prevent the form from shown, this works.

Problem is when a section of the west region is clicked (not the actual button) it shows the form. I haven't found an event that fires off to prevent this from happening.

I've included a screen shot, you'll see the expand button. If anywhere below this button is clicked, the form opens.

Here's the code in my Viewport that prevents the form from appearing.

},{
region: 'west',
collapsible: true,
title: 'Order',
id: 'westRegion',
width: 300,
items: [{
xtype: 'searchtab',
id : 'searchtab'
}
],
//collapsed:'true',
listeners: {
scope: this,
beforeexpand: function(p , animate , eOpts) {

// Used to prevent expansion of search panel for certain tabs

var tab = Ext.getCmp("mainTab");
if(tab.activeTab.title == 'Maintenance') {
return false;
}


if(tab.activeTab.title == 'Configurator') {

var configTab = Ext.getCmp("configuratorTab");
if(configTab.activeTab.title == 'Inbound/Outbound/Approval' || configTab.activeTab.title == 'Collection/Related Items') {

return false;
}

}

if(tab.activeTab.title == 'Order Management') {

return false;

}


return true;
}
}
},

slemmon
2 Oct 2013, 2:02 PM
I'm afraid there's not a beforefloat event to listen to. You can set floatable (http://docs-origin.sencha.com/extjs/4.2.2/#!/api/Ext.grid.Panel-cfg-floatable) to true/false on the west panel to manage whether it can float out or not based on some other application condition which is a close second.