Thank you for reporting this bug. We will make it our priority to review this report.
  1. #1
    Ext JS Premium Member
    Join Date
    Sep 2007
    Posts
    55
    Vote Rating
    0
    mvarshavsky is on a distinguished road

      0  

    Default 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 element
    Code:
        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;
        }

  2. #2
    Sencha - Support Team scottmartin's Avatar
    Join Date
    Jul 2010
    Location
    Houston, Tx
    Posts
    8,999
    Vote Rating
    456
    scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future

      0  

    Default


    Have you tried this with 4.1.1 GA?

    Scott.

  3. #3
    Ext JS Premium Member
    Join Date
    Sep 2007
    Posts
    55
    Vote Rating
    0
    mvarshavsky is on a distinguished road

      0  

    Default


    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?

  4. #4
    Sencha - Support Team scottmartin's Avatar
    Join Date
    Jul 2010
    Location
    Houston, Tx
    Posts
    8,999
    Vote Rating
    456
    scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future

      0  

    Default


    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:

    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);
            }
    Scott.

Thread Participants: 1