PDA

View Full Version : extend window



Stephan123
28 Feb 2010, 9:10 AM
Hello !

For a new project i will build same standard windows.
This windows are the basis for the parts of a project.
For example. I have a standard window like this:


Ext.ns("App");

App.standard = new Ext.Window({
title: 'Hallo',
width: 600,
height: 300,
items: [{
baseCls:'x-plain',
layout:'table',
layoutConfig: {
columns: 2
},
defaults: {
width:200,
height: 400
},
items:[{
id: 'inhalt1'
},{
id: 'inhalt2'
}]
}]
});

In the second step i test a simple form in a vanilla page.
For example a simple form:


var form = new Ext.form.FormPanel({
title : "Inhalt 1",
width: 300,
height: 200,
items : [{
xtype : "textfield",
name : "field1",
fieldLabel : "Field 1"
}, {
xtype : "textfield",
name : "textvalue",
fieldLabel : "Field 2"
}, {
xtype : "textfield",
name : "field3",
fieldLabel : "Field 3"
}]
});

In the next step i will combine my standard window with my form.
I will insert the form in the the area of the standard window with the id 'inhalt1'.

I think the extend of the standard window is the best way.


App.form = Ext.extend(App.standard,{

});

And here i need an information.

Your sincerly

Stephan