-
3 Apr 2012 1:51 PM #51
Drag & Drop
Drag & Drop
Hello Scorpie,
I have been working on the D&D for iframe for a while now which I needed for my app: WIDGaT
The only solution I found was to register a script in the dom of the document in the frame which relay the mouse events to the top window (might cause cross domain problems).
Here is a link to the script I'm using:
https://github.com/arc-teesside/WIDGaT/blob/master/temp/TimerTemplate/scripts/editorlib.js
This only works on Firefox and Chrome so far, IE uses a different way of firing events (looking into it).
It's the first time I'm using ExtJS and it's a pretty big app so the code is most definitely not optimised but I'm doing exactly what you are looking for so keep looking you'll probably find what you need
Franck.
-
4 Apr 2012 9:30 AM #52
Thanks Frank!
Hm, I have taken a different approach yet I am stuck.
You can see what I tried to do @ http://supranet.dyndns.org/VAM/viewport.html
Basically its a viewport with a center panel thats loaded with MIF4.0A2, in which a HTML page containing a fabricjs instance is loaded.
You can try for yourself, the drag&drop does 'work', however its buggy as hell. I tried different DropTargets on different levels, to no avail.
Any tips are welcome
I`m from Holland!
-
4 Apr 2012 3:24 PM #53
Drag & Drop
Drag & Drop
Hi Scorpie,
I am not familiar with fabricjs but according to what I saw in your app, the drag stops as soon as you enter the iframe; I think this is because you don't forward the mouse events to the top document. I only tried it on Chrome but I think you need to register mouse listeners on the document within the iframe to relay at least the following events:
- document.mousemove
- document.mouseup
to the top document (top.document).
If you look at my code, the coordinates I send to the top document include the width and height of the borders of the container of the MIFrame component (hardcoded) to avoid a "jump" on the thumbnail when dragging.
Hope it helps,
F.
-
5 Apr 2012 4:04 AM #54
Thanks Franck, i`m diving into it.
I`m from Holland!
-
5 Apr 2012 7:15 AM #55
So..............i`ve managed to get it working for a great deal. The only thing I cant wrap my head around now is the fact that there is no onNodeDrop event being fired whenever the node from the Dataview is dropped on the canvas. I dont know if this is fabricjs related, will check it out.
Another frustrating bug is the fact that my Firefox & Firebug combo crashes everytime I do a refresh on my current viewport. Something that I need to fix
Anyway, I`ve updated the code @ the URL I mentioned, so if anybody sees why my nodedrop event doesnt get fired, please do tell
I`m from Holland!
-
12 Apr 2012 11:49 AM #56
getFrameDocument not working for IE in Quirks mode?
getFrameDocument not working for IE in Quirks mode?
Hi Doug,
Thanks for all your hard work! I took a look at the 2.1.5 version of getFrameDocument(), and it looks like this:
Code:getFrameDocument : function() { var win = this.getWindow(), doc = null; try { doc = (Ext.isIE && win ? win.document : null) || this.dom.contentDocument || window.frames[this.dom.name].document || null; } catch (gdEx) { ELD.clearDocumentCache && ELD.clearDocumentCache(this.id); return false; // signifies probable access restriction } doc = (doc && Ext.isFunction(ELD.getDocument)) ? ELD.getDocument(doc,true) : doc; return doc; }
The alpha2 version is this:
It looks like the Ext.isIE shortcut in the 2.1.5 version is removed from the alpha2 version, and I believe this is causing issues with running in IE in Quirks mode.Code:getFrameDocument : function(assertAccess) { var win = this.getWindow(), doc = null; try { doc = win.contentDocument || this.dom.contentDocument || window.frames[this.dom.name].document || win.document; } catch (gdEx) { doc = false; // signifies probable access restriction } return Ext.isDocument(doc, assertAccess !== false) ? doc : false; }
What is happening for me is that the parent document, not the iframes document, is being returned from thecall. TheCode:window.frames[this.dom.name].document
property has the correct reference to the iframe document, but in the alpha2 code, that code isn't reached.Code:win.document
Is this an intentional decision that you made?
Cheers,
Nicholas
-
18 Apr 2012 5:12 AM #57
ManagedIFrame and ExtJS 4.1 RC3?
ManagedIFrame and ExtJS 4.1 RC3?
Does this MIF work with the ExtJS 4.1 RC3?
Stewart McGuire
Ext JS 2.x, 3.x, 4.x - User / Ext Designer 1.2 - User / Sencha Architect 2 - User
-
8 May 2012 6:48 AM #58
MI A2 throws error with Extjs 4.1 final release
MI A2 throws error with Extjs 4.1 final release
Hi,
we are getting error as (a.replace is not a function), when try to use the MI A2 with Extjs 4.1 final release.
Please let us know when we could get the latest version of MI, which could work with Extjs 4.1 code line.
Thanks in advance.
Regards,
Soosai
-
14 May 2012 6:20 AM #59
Miframe size problem
Miframe size problem
Hi guys, i've a big problem (maybe it's only because my newbie level
).
I've a simple function wich create a window with a miframe inside; inside that i open a binary stream to see a pdf document.
If i open the page in chrome everything goes ok, but if i use ie and ff, the iframe content is resized on his height; it happen also if a open a webpage instead a pdf stream...
Behind you can see both my code and problem, maybe someone can help me.
Thanks in advice
Davide
Code:function mostraWin(){ if(!Ext.getCmp('finestraPdf')){ Ext.create('Ext.window.Window', ({ id: 'finestraPdf', constrain: true, height: 600, width: 1000, title: 'PDF viewer', draggable: false, resizable: false, items: { xtype :'miframe', title: 'PDF', defaultSrc :'pdf/ritornaPdf.action' } })).show() } };
Cattura.jpg
-
14 May 2012 7:09 AM #60
@dady1981 --
Start with:
in your Window !Code:layout : 'fit'
"be dom-ready..."
Doug Hendricks
Maintaining ux: ManagedIFrame, MIF2 (FAQ, Wiki), ux.Media/Flash, AudioEvents, ux.Chart[Fusion,OFC,amChart], ext-basex.js/$JIT, Documentation Site.
Got Sencha licensing questions? Find out more here.


Reply With Quote

