PDA

View Full Version : form in a window



Stephan123
6 Feb 2012, 8:52 AM
Hello !

I have a simple form.
I want to re-use this form.
This form I have stored in a namespace.

------------------------------

Ext.namespace('MyApps','MyApps.Programmvarianten');


MyApps.Programmvarianten.form = Ext.extend(Ext.Window, {
height: 114,
width: 400,
title: 'My Window',

initComponent: function() {
Ext.applyIf(this, {
items: [
{
xtype: 'form',
items: [
{
xtype: 'textfield',
fieldLabel: 'Label'
}
]
}
]
});

MyApps.Programmvarianten.form.superclass.initComponent.call(this);
}
});




var fenster = new Ext.Window({
title: 'vorhandene Programmvariante bearbeiten',
id: 'myTest',
autoWidth: true,
modal: true,
autoHeight: true,
shadow: false,
border: false,
x: 270,
y: 160
});



var form = new MyApps.Programmvarianten.form();
fenster.add(form);
fenster.doLayout();
fenster.show();

----------------------------------

I only see the header of the window.
Who can help


Your sincerly

Stephan

-----------------------------
My sandbox:

http://snippets.stephankrauss.de/
http://extjs.stephankrauss.de/index.php?aufruf=96

mitchellsimoens
6 Feb 2012, 8:57 AM
It looks like you are trying to add a Window into a Window which isn't valid.

Stephan123
6 Feb 2012, 9:28 AM
Hello !

Thanks for the answer.
I have changed the panel.
---------------------



Ext.namespace('MyApps','MyApps.Programmvarianten');

MyApps.Programmvarianten.form = {
items: [
{
xtype: 'form',
items: [
{
xtype: 'textfield',
fieldLabel: 'Label'
}
]
}
]
}

var fenster = new Ext.Window({
title: 'vorhandene Programmvariante bearbeiten',
id: 'myTestWindow',
title: 'my window',
autoWidth: true,
modal: true,
autoHeight: true,
shadow: false,
border: false,
x: 20,
y: 20
});

fenster.add(MyApps.Programmvarianten.form);
fenster.doLayout();
fenster.show();



Is this the solution ? :">

Your sincerly

Stephan

-----------------------
my sandbox:

http://snippets.stephankrauss.de/
http://extjs.stephankrauss.de/index.php?aufruf=104