Hybrid View

    Thank you for reporting this bug. We will make it our priority to review this report.
  1. #1
    Ext JS Premium Member robincasey's Avatar
    Join Date
    Nov 2007
    Location
    Netherlands, Arnhem
    Posts
    53
    Vote Rating
    0
    robincasey is on a distinguished road

      0  

    Default [REOPEN-103][3.0.0] DD of Resizable does not listen to constrainTo

    [REOPEN-103][3.0.0] DD of Resizable does not listen to constrainTo


    On the ExtJS examples page of Resizables, run:
    Code:
    var div = Ext.DomHelper.insertBefore(document.body.firstChild, {
        tag: "div",
        style: "background:#ff0;width: 200px;height: 300px;"
    });
    var img = Ext.DomHelper.append(div, {
        tag: "img",
        src: "zack.jpg",
        height: 100
    })
    var transparent = new Ext.Resizable(img, {
        wrap: true,
        dynamic: true,
        draggable: true,
        constrainTo: div
    });
    I am expecting the Resizable, when draggable, not to be able to be dragged out of the constrainTo area.


    Added:
    transparent.dd.constrainTo(transparent.constrainTo); is a possible patch
    Last edited by robincasey; 22 Jul 2009 at 3:33 AM. Reason: Added possible patch

  2. #2
    Ext User
    Join Date
    Jul 2007
    Location
    Florida
    Posts
    9,996
    Vote Rating
    5
    mjlecomte will become famous soon enough mjlecomte will become famous soon enough

      0  

    Default


    Thanks for this and the other specific reports (not lumped together).

    I also noted that when resizing I can sometimes resize that resizable item slightly outside of the div. Play with it a little bit though, sometimes it constrains inside, but depending where you drag it, it doesn't constrain the resizing either.

  3. #3
    Ext User
    Join Date
    Aug 2009
    Posts
    34
    Vote Rating
    0
    david l is on a distinguished road

      0  

    Default


    I got the constrainTo part to work, but the problem described in the post above is what I am running in to now
    http://extjs.com/forum/showthread.ph...607#post370607

  4. #4
    Ext User
    Join Date
    Aug 2009
    Posts
    34
    Vote Rating
    0
    david l is on a distinguished road

      0  

    Default


    I do believe I fixed the problem with the resized element not being constrained correctly...

    the patch below should fix it in addition to the fix in the link to the other post to initialize it
    Code:
    Ext.override(Ext.Resizable, {
        resizeElement : function(){
            var box = this.proxy.getBox();
            if(this.updateBox){
                this.el.setBox(box, false, this.animate, this.duration, null, this.easing);
            }else{
                this.el.setSize(box.width, box.height, this.animate, this.duration, null, this.easing);
            }
            this.updateChildSize();
            if(!this.dynamic){
                this.proxy.hide();
            }
    //////////////////
            if(this.draggable && this.constrainTo) {
                this.dd.resetConstraints();
                this.dd.constrainTo(this.constrainTo);
            }
    //////////////////
            return box;
        }
    });

  5. #5
    Sencha User ludoo's Avatar
    Join Date
    Mar 2007
    Location
    France, Luxembourg
    Posts
    60
    Vote Rating
    2
    ludoo is on a distinguished road

      0  

    Default


    This patch works well only if item has been resized before.
    Try to drag item inside container before resizing, then constraints won't be applied.

    May be an init problem ?

  6. #6
    Ext User
    Join Date
    Aug 2009
    Posts
    34
    Vote Rating
    0
    david l is on a distinguished road

      0  

    Default


    look at the url in post #4, it has the init changes as well

film izle

hd film izle

film sitesi

takipci kazanma sitesi

takipci kazanma sitesi

güzel olan herşey

takipci alma sitesi

komik eğlenceli videolar