-
20 Aug 2010 7:06 AM #1Sencha - Community Support Team
- Join Date
- Mar 2007
- Location
- The Netherlands
- Posts
- 24,251
- Vote Rating
- 41
[DUPE/FIXED] XDS produces incorrect code for FormPanel and BorderLayout regions.
[DUPE/FIXED] XDS produces incorrect code for FormPanel and BorderLayout regions.
(I'm not using XDS myself and I am only reporting this for another user, so correct me if I've missed something)
The Designer doesn't take into account that BasicForm and BorderLayout.Region are constructed from the initialConfig of the component.
Example: The following two panels won't use the marked config options, because they are not part the the object's initialConfig.
Code:MyPanelUi = Ext.extend(Ext.Panel, { title: 'My Panel', region: 'west', width: 200, split: true, initComponent: function() { MyPanelUi.superclass.initComponent.call(this); } }); MyFormUi = Ext.extend(Ext.form.FormPanel, { title: 'My Form', layout: 'form', standardSubmit: true, url: 'myurl.html', initComponent: function() { MyFormUi.superclass.initComponent.call(this); } });
-
20 Aug 2010 7:16 AM #2Sencha - Community Support Team
- Join Date
- Mar 2007
- Location
- The Netherlands
- Posts
- 24,251
- Vote Rating
- 41
I read that the next maintenaince release already fixes the BasicForm problem. Does it also fix the BorderLayout.Region problem?
-
20 Aug 2010 7:33 AM #3Sencha - Community Support Team
- Join Date
- Mar 2007
- Location
- The Netherlands
- Posts
- 24,251
- Vote Rating
- 41
I did a quick scan of the Ext code and initialConfig is used by a lot more components than I thought.
AnchorLayout
BorderLayout
ToolbarLayout
ComboBox
SliderField
GridView
FormPanel
and some other components that you can't define in XDS.
-
20 Aug 2010 12:34 PM #4Sencha - Desktop Packager Dev Team
- Join Date
- Mar 2007
- Location
- Baltimore, MD.
- Posts
- 1,745
- Vote Rating
- 5
Hey Condor,
Yes all of the configurations for components that are read from initialConfig are going to be applied to a config object and passed into a constructor, rather than set directly on the prototype or set within initComponent.
The change to, for example the FormPanels, will look like this:
Since they will be passed into the constructor as a part of the config object, they will be set to the initialConfig object in Ext.Component.constructor.Code:MyFormUi = Ext.extend(Ext.form.FormPanel, { title: 'My Form', layout: 'form', constructor: function(config){ MyFormUi.superclass.constructor.call(this, Ext.apply(config || {}, { standardSubmit: true, url: 'myurl.html' })); }, initComponent: function() { MyFormUi.superclass.initComponent.call(this); } });
-
20 Aug 2010 11:17 PM #5Sencha - Community Support Team
- Join Date
- Mar 2007
- Location
- The Netherlands
- Posts
- 24,251
- Vote Rating
- 41
No, that's wrong. It should be:
1. You should not modify the config object (it could be reused to create more objects).Code:MyFormUi.superclass.constructor.call(this, Ext.apply({ standardSubmit: true, url: 'myurl.html' }, config));
2. You should be able to override the default options with the config object.
ps. Which properties do you currently have marked as being required in the constructor?
-
21 Aug 2010 5:03 AM #6Sencha - Desktop Packager Dev Team
- Join Date
- Mar 2007
- Location
- Baltimore, MD.
- Posts
- 1,745
- Vote Rating
- 5
Yes I know, I just typed it up wrong but that's what I'm doing. It will be the same as the Store generated code:
Which properties? All that are read from initialConfig of course. In the case of FormPanel, all that belong to BasicForm.Code:MyStore = Ext.extend(Ext.data.JsonStore, { constructor: function(cfg) { cfg = cfg || {}; MyStore.superclass.constructor.call(this, Ext.apply({ storeId: 'MyStore' }, cfg)); } });
-
23 Aug 2010 12:45 AM #7
Thank you for reporting this bug. We will make it our priority to review this report.
Similar Threads
-
[FIXED] [2.2] BorderLayout Regions do not follow stateful:false
By watrboy00 in forum Ext 2.x: BugsReplies: 1Last Post: 5 Mar 2009, 11:52 AM -
Defining regions in BorderLayout
By gogofe in forum Ext 2.x: Help & DiscussionReplies: 3Last Post: 24 Aug 2008, 7:30 AM -
[FIXED] BorderLayout north and south regions wrong when using percentages
By rreckel in forum Ext GWT: Bugs (1.x)Replies: 2Last Post: 2 May 2008, 12:23 PM -
Fixed Width (Non-Resizable) East/West Regions in a BorderLayout
By krogers in forum Ext 2.x: Help & DiscussionReplies: 4Last Post: 7 Feb 2008, 6:28 PM


Reply With Quote