JoepRonde
19 Sep 2012, 5:26 AM
I want to extend a formpanel with default frame = true. The code below defines a custom class for a floating, draggable formpanel with a frame. Creating an instance of this class doesn't show a frame. It seems that the initConfig doesn't set the frame to true. Why not?
Only when I create a instance of this class with a config object with frame = true it shows a frame.
Can anyone explain this?
Ext.define('MyForm', {
extend: 'Ext.form.Panel',
config: {
title: 'This panel wants a frame',
width: 200,
height: 100,
frame: true, // setting frame to true should give a frame, but it doesn't
floating: true ,
draggable: true
},
constructor: function(config) {
// Calling the constructor of the parent class.
this.callParent(arguments);
// Initializing the config settings.
this.initConfig(config);
}
});
Ext.create('MyForm').showAt(10,10);
Ext.create('MyForm', {title: 'Now it has a frame', frame: true}).showAt(250,10);
Only when I create a instance of this class with a config object with frame = true it shows a frame.
Can anyone explain this?
Ext.define('MyForm', {
extend: 'Ext.form.Panel',
config: {
title: 'This panel wants a frame',
width: 200,
height: 100,
frame: true, // setting frame to true should give a frame, but it doesn't
floating: true ,
draggable: true
},
constructor: function(config) {
// Calling the constructor of the parent class.
this.callParent(arguments);
// Initializing the config settings.
this.initConfig(config);
}
});
Ext.create('MyForm').showAt(10,10);
Ext.create('MyForm', {title: 'Now it has a frame', frame: true}).showAt(250,10);