extjs - center a formPanel on a normal panel

Posted by Ben on Stack Overflow See other posts from Stack Overflow or by Ben
Published on 2010-05-21T09:28:00Z Indexed on 2010/05/25 19:41 UTC
Read the original article Hit count: 476

Filed under:

Hi there,

I'm using extjs and just trying to solve a simple problem: I have a form with a fixed width. I want to Center this form within a normal Ext.Panel. I'm trying to achieve this the 'css-way' - setting the left and right margin to 'auto'.

But this doesn' work, it seems the margins are just ignored.

The Code:

    var curStateForm = new Ext.FormPanel({
        title:'test',
        width:300,
bodyStyle:'margin:5px auto 0 auto',
items: [edIst, edAdjust, edSumme]

});

var testPanel = new Ext.Panel({ width: '100%', frame:true, items:[curStateForm] });

Thx to all!

© Stack Overflow or respective owner

Related posts about extjs