-
22 Jul 2009 2:54 AM #1
[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:
I am expecting the Resizable, when draggable, not to be able to be dragged out of the constrainTo area.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 });
Added:
transparent.dd.constrainTo(transparent.constrainTo); is a possible patchLast edited by robincasey; 22 Jul 2009 at 3:33 AM. Reason: Added possible patch
-
22 Jul 2009 10:44 AM #2
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.MJ
API Search || Ext 3: docs-demo-upgrade guide || User Extension Repository
Frequently Asked Questions: FAQs
Tutorial: Grid (php/mysql/json) , Application Design and Structure || Extensions: MetaGrid, MessageWindow
-
7 Aug 2009 12:45 PM #3
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
-
8 Aug 2009 2:29 PM #4
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; } });
-
6 Sep 2009 11:16 PM #5
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 ?
-
7 Sep 2009 5:22 PM #6
look at the url in post #4, it has the init changes as well
-
26 Nov 2009 3:50 AM #7
Fix applied to svn in rev #5679 for patch release 3.1.
Thanks for the patch.Evan Trimboli
Sencha Developer
Twitter - @evantrimboli
Don't be afraid of the source code!
-
2 Mar 2010 1:44 PM #8
3.1.1 Drag Drop Resizable constrainTo
3.1.1 Drag Drop Resizable constrainTo
Regression in 3.1.1 :[???-670] DragDrop constrainTo after container resize
-
2 Mar 2010 2:09 PM #9Sencha - Sencha Touch Dev Team
- Join Date
- Mar 2007
- Location
- Redwood City, California
- Posts
- 3,652
- Vote Rating
- 14
Reopened, closing 670 as a duplicate.
-
9 Nov 2010 1:17 PM #10onerror = setTimeout(Ext.emptyFn, Infinity)

Thank you for reporting this bug. We will make it our priority to review this report.


Reply With Quote