PDA

View Full Version : Split Portal Columns



voodoov
1 Mar 2012, 1:26 AM
Hi,

In the portal example, how can I split columns?

If I convert the 'column' layout to 'border' (in PortalPanel.js), I couldn't add columns (regions in this case) dynamically. On the other hand the scrolls disappears. It seems that the 'app-portal' layout has lost its functionality.

Thank you in advance.

mitchellsimoens
1 Mar 2012, 1:33 PM
Are you wanting to have a column collapse or something?

voodoov
2 Mar 2012, 12:58 AM
I want to change columns widths using the split bar situated between them.
I have edited the following image using photoshop to tell you what I mean.

I appreciate your concern

32303

mitchellsimoens
2 Mar 2012, 6:05 AM
I wonder if you can use resizable on the columns...

voodoov
2 Mar 2012, 10:26 PM
I have used resizable. But you must handle column widths yourself.
Maybe with some configuration we can use resizable works similar to split.
Is there any way to do that?

voodoov
19 Mar 2012, 11:12 AM
I have handled columnWidths in this way:
http://www.sencha.com/forum/showthread.php?189220-Component-with-HBOX-layout-and-resizable-children&p=759693&viewfull=1#post759693
(http://www.sencha.com/forum/showthread.php?189220-Component-with-HBOX-layout-and-resizable-children&p=759693&viewfull=1#post759693)
Don't know if this is the best way to do it though.

Daniil
24 Jul 2012, 4:42 PM
Hi,

Personally, I would try to override Portal using HBox instead Column layout.

I would start to override from this code.

Ext.app.PortalPanel.override({
initComponent : function () {
var me = this;

// Implement a Container beforeLayout call from the layout to this Container
this.layout = {
type : 'hbox',
align : 'stretch'
};

Ext.app.PortalPanel.superclass.initComponent.call(this);

this.addEvents({
validatedrop : true,
beforedragover : true,
dragover : true,
beforedrop : true,
drop : true
});
this.on('drop', this.doLayout, this);
}
});

Sure, needs more overrides to get it all working. For example, a JS error occurs on dragging. Though not always.

I can't estimate how difficult it might be, but I believe it's possible.

The benefit is the power of the HBox layout, i.e. splitting and, probably, reordering columns.

At least, with the above override you will be able to split columns if configure Ext.resizer.Splitter between the columns.