views:

522

answers:

1

Hello:

Here is a simple illustration of what I mean. It works in IE, and FF, but not in Safari.

I have four panels which are dynamically added to a tabpanel item. Three are grid panels, and one is a form panel. I need to preserve the grids proportions or sizes. I tried several layout methods (table, column, absolute etc), and nothing seems work so far. For table layout, all sizes end up being the same width. It seems my best bet is column layout, and they seem to render properly in FF, IE, but not in Safari as shown in the image. (Here it seems that column goes to second row, when the item does not fit into the current row). Initially, the title bar, and several of the column headings does not show.

Any suggestions.

Thank you.

alt text

+1  A: 

Your best bet is probably a BorderLayout. I'm not sure how you want the page to look so I can't tell what specific configuration would be best

EDIT: Since you are using Ext 3.1, you really should check out the new HBox (sample) and VBox (sample) layouts. They are extremely powerful and will do exactly what you need.

Ext.onReady(function() {
    var panel = new Ext.Panel({
        id:'main-panel',
        baseCls:'x-plain',
        renderTo: Ext.getBody(),
        width: 600,
        height: 400,
        layout: {
            type: 'vbox',
            align:'stretch'
        },
        defaults: {
            xtype: 'panel',
            baseCls:'x-plain',
            flex: 1,
            layout: {
                type: 'hbox',
                align: 'stretch'
            }
        },
        items: [{
            defaults: {
                xtype: 'panel',
                frame: true
            },
            items: [{
                title: 'Item 1',
                flex: 1
            },{
                title: 'Item 2',
                flex: 2
            }]
        },{
            defaults: {
                xtype: 'panel',
                frame: true
            },
            items: [{
                title: 'Item 3',
                html: 'sssssssssssss',
                flex: 2
            },{
                title: 'Item 4',
                flex: 1
            }]
        }]
    });
});
bmoeskau
Thank you for the input, but I need two items in two rows, I am not sure how to do this by splitting the regions. row 1a = 150 width, height 300b = 600 width, height 300row 2c = 600 width, height 300d = ~200 width, height 300I tried a simple column model case (http://pssnet.com/~devone/pssops3/extjstest4.php), and the behavior in Safari is definitely broken. Works fine in IE, and FF.
Natkeeran
Thank you very much. I added the full panel to the tab item. Thanks again.
Natkeeran
It is really hard to get all the browsers (FF, IE, Safari) to co-operate. I waste a lot of time trying to do so.
Natkeeran
Once you get proficient with Ext it's really not too bad -- easier then with most other frameworks. At the end of the day though, supporting 4 or 5 major browsers plus multiple versions is not an easy chore regardless of framework.
bmoeskau