Hybrid View
-
7 Jul 2012 10:05 AM #1
4.0.7 - getPageBox / setBox mismatch
4.0.7 - getPageBox / setBox mismatch
REQUIRED INFORMATION
Ext version tested:- Ext 4.0.7
Browser versions tested against:- applicable to all
Description:
Library's getPageBox() returns objet with top/left set, while setBox() expects them as x/y. Which renders the following documentation statement false:
Return an object defining the area of this Element which can be passed to setBox to set another Element's size/location to match this elementCode:getPageBox : function(getRegion) { var me = this, el = me.dom, isDoc = el === document.body, w = isDoc ? Ext.Element.getViewWidth() : el.offsetWidth, h = isDoc ? Ext.Element.getViewHeight() : el.offsetHeight, xy = me.getXY(), t = xy[1], r = xy[0] + w, b = xy[1] + h, l = xy[0]; if (getRegion) { return Ext.create('Ext.util.Region', t, r, b, l); } else { return { left: l, top: t, width: w, height: h, right: r, bottom: b }; } } //vs setBox: function(box, adjust, animate) { var me = this, w = box.width, h = box.height; if ((adjust && !me.autoBoxAdjust) && !me.isBorderBox()) { w -= (me.getBorderWidth("lr") + me.getPadding("lr")); h -= (me.getBorderWidth("tb") + me.getPadding("tb")); } me.setBounds(box.x, box.y, w, h, animate); return me; }
-
7 Jul 2012 4:07 PM #2
Have you tried this with 4.1.1 GA?
Scott.
-
8 Jul 2012 8:28 AM #3
Scott, thanks for responding. I've answered to your similar inquiry in another post: http://www.sencha.com/forum/showthre...l=1#post850135
Has this already been fixed in 4.1.1? Is Sencha under the assumption that users are upgrading libraries as soon as releases become available?
-
8 Jul 2012 10:33 AM #4
The issue here is that 4.07 had many issues related to layouts and how they were managed.
In recognizing this, there were many changes made to 4.1.1 to fix these issue
Due to the amount of changes, we request that users check how things are working in 4.1 due to the vast amount of differences.
To be short, 4.07 has problems.
It is recommended in all aspects, that if you are using Ext4, that you use 4.1.1
If there is an inherit problem with your issue, it will be much easier/quicker to change in 4.1
In regards to your post, setBox param now has the following:
Scott.Code:setBox: function(box) { var me = this, width = box.width, height = box.height, top = box.top, left = box.left; if (left !== undefined) { me.setLeft(left); } if (top !== undefined) { me.setTop(top); } if (width !== undefined) { me.setWidth(width); } if (height !== undefined) { me.setHeight(height); }
Thank you for reporting this bug. We will make it our priority to review this report.


Reply With Quote