-
24 Feb 2011 3:23 AM #1
[OPEN]Component config property 'margin' issues
[OPEN]Component config property 'margin' issues
Applies to Ext JS 4 Preview 1
It looks like ExtJS 3 'margins' config property has become 'margin' in ExtJS4. This is not documented properly.
'margins' can still be used as it seems, but when provided as object, it does not get rendered properly, see testcase below (margin left becomes margin right when rendered, margin top becomes margin bottom when rendered).
Code:Ext.onReady(function(){ // ---- Create Viewport with border layout ---------------------- Ext.create('Ext.Viewport',{ layout: 'border', padding:20, defaults: { padding: 5, frame: true }, items:[ { region: 'north', title: 'Panel North', html: '<h2>I am North with a left margin of 150 and top and bottom margin of 5</h2>', // // ExtJS 3 'margins' config property as defined in BoxComponent is now // ExtJS 4 'margin' as defined in Ext.Component // // margin config works when provided as String //margin: '5 0 5 150', // // margin config also works when provided as Object //margin: {top:5, right:0, bottom:5,left:150}, // // outdated margins config works NOT correctly in Ext4 preview 1 when provided as Object margins: {top:5, right:0, bottom:5,left:150}, // // outdated margins config works correctly when provided as String //margins: '5 0 5 150', flex: 0.5 }, { region: 'west', title: 'Panel West', html: '<h2>I am West</h2>', flex: 0.75 }, { region: 'center', title: 'Panel Center', html: '<h2>I am Center</h2>', margins: '0 5 0 5' }, { region: 'east', title: 'Panel East', html: '<h2>I am East</h2>', flex: 0.75 } ] }); // END of onReady });
-
24 Feb 2011 8:35 AM #2
There's no change in config names.
What has changed is that you must now use the string form of the configuration.
I'll look into this.Search the forum: http://www.google.com/coop/cse?cx=01...%3Az7of1ufqccu
Read the docs too: http://extjs.com/deploy/dev/docs/
Scope: http://extjs.com/forum/showthread.ph...642#post257642
-
24 Feb 2011 9:29 AM #3
Strange...
Why then do the Ext4 docs for Component use 'margin' and it works with 'margin' as string and object?
I currently do not have the time to further investigate, just wanted to point this out.
Thanks for looking into this!
-
24 Feb 2011 11:21 AM #4
Yes, the way it is processed has been changed. I have just fixed this to accept margin and margins as configuration.
Search the forum: http://www.google.com/coop/cse?cx=01...%3Az7of1ufqccu
Read the docs too: http://extjs.com/deploy/dev/docs/
Scope: http://extjs.com/forum/showthread.ph...642#post257642
Thank you for reporting this bug. We will make it our priority to review this report.
Similar Threads
-
[OPEN-1294] singleSelect config in RowSelectionModel should be a property
By Eric24 in forum Ext 3.x: BugsReplies: 0Last Post: 28 Sep 2010, 8:41 AM -
animate margin property
By hpet in forum Ext 3.x: Help & DiscussionReplies: 1Last Post: 25 Aug 2010, 9:57 AM -
[OPEN-969] TreeGrid Component and IE 6/7 white-space "nowrap" Issues
By MckenziS in forum Ext 3.x: BugsReplies: 11Last Post: 17 May 2010, 8:13 AM -
[OPEN-19] Enter key (numeric area) in Component Config not working
By vanbroup in forum Ext Designer: BugsReplies: 2Last Post: 29 Mar 2010, 3:00 PM


Reply With Quote