2011-09-29 56 views
0

我是Ext-js的新用户,我开发了一个窗体,但无法将它对齐到中心。 这是我的代码使用Ext-js开发用户界面

Ext.onReady(function() 
{ 

    Ext.QuickTips.init(); 
    Ext.form.Field.prototype.msgTarget = 'side'; 



    var reg_form = new Ext.FormPanel({ 
    renderTo: document.body, 
    title: 'Employee Registration Form', 
    width:600, 
    height:500, 
    bodyStyle: 'padding:10px 10px 15px 15px;background:#dfe8f6;', 
    items: [ 

    { 

    xtype: 'numberfield', 
    fieldLabel: 'Employee Id', 
    name: 'id', 
    decimalPrecision:2, 
    allowBlank: false 
    }, 
    { 

    xtype: 'textfield', 
    fieldLabel: 'Employee Name', 
    name: 'name', 
    allowBlank: false, 
    vtype:'alpha' 

    } 
] 
}); 

}); 

感谢您的高级。

回答

0

你需要申请css要做到这一点,或使用formpanel

0

另一种方式的x & y CONFIGS来解决这个问题: 使用

Ext.Window({ 
    maximizeble : false, 
    resizeble : false, 
    closable: false, 
    minimizeble: false, 
    ... 
})