-
19 Sep 2012 10:31 AM #1
[4.1.2] injectEvent problem under IE
[4.1.2] injectEvent problem under IE
REQUIRED INFORMATION
Ext version tested:- Ext 4.1.2
Browser versions tested against:- IE9
DOCTYPE tested against:- <!DOCTYPE html>
Description:- If use iframe with ExtJS then 'injectEvent' method of EventObject in parent page causes few issues. If iframe inside a window then window dragging is interrupted. Also, if open window with iframe, close and open again then an error occurs in handleSingleEvent of EventManager. The issue doesn't occur in 4.1.1
Steps to reproduce the problem:- Open the sample from above test case (it contains from two files: main page and page is loaded inside iframe)
- Click on the button to show a window
- Try to drag the window
- Notice that dragging performance is bad (in 4.1.1 the dragging is smooth)
- Close the window and click again on the button
- Exception occurs in handleSingleEvent method of EventManager (on 'attachItem.firing = true;' line, attachItem is null)
The result that was expected:- All should works correctly like in 4.1.1
The result that occurs instead:- Window dragging is interrupted
- An error occurs after window reopening
Test Case:
Main page
Page in iframeCode:<!DOCTYPE html> <html> <head> <title></title> <link rel="stylesheet" type="text/css" href="../../resources/css/ext-all.css" /> <script type="text/javascript" src="../../ext-all.js"></script> <script type="text/javascript"> function showWindow() { Ext.create("Ext.window.Window", { layout: "fit", width: 300, height: 300, title : "Window with iframe", closable: true, items:[ { xtype: "component", autoEl : { tag : "iframe", src : "child.html", frameborder : 0 }, onRelayedEvent : function (event) { var iframeEl = this.el, iframeXY = iframeEl.getXY(), eventXY = event.getXY(); event.xy = [iframeXY[0] + eventXY[0], iframeXY[1] + eventXY[1]]; event.injectEvent(iframeEl); event.xy = eventXY; }, listeners : { beforedestroy : function () { if (this.rendered) { Ext.EventManager.removeAll(this.el.dom.contentWindow.document); } }, afterrender : function () { this.el.on("load", function(){ var doc = this.el.dom.contentWindow.document, fn = this.onRelayedEvent; Ext.EventManager.removeAll(doc); Ext.EventManager.on(doc, { mousedown: fn, mousemove: fn, mouseup: fn, click: fn, dblclick: fn, scope: this }); }, this); } } } ] }).show(); } Ext.onReady(function(){ Ext.create("Ext.button.Button", { renderTo: Ext.getBody(), text: "Show window", handler: showWindow }); }); </script> </head> <body> </body> </html>
Code:<html> <head> <title></title> <link rel="stylesheet" type="text/css" href="../../resources/css/ext-all.css" /> <script type="text/javascript" src="../../ext-all.js"></script> </head> <body> </body> </html>
HELPFUL INFORMATION
If remove ExtJS from the iframe page then issues are gone
Screenshot or Video:- none
Debugging already done:- none
Possible fix:- not provided
Additional CSS used:- only default ext-all.css
Operating System:- MS Vista
-
19 Sep 2012 10:44 AM #2Sencha - Senior Forum Manager
- Join Date
- Mar 2007
- Location
- St. Louis, MO
- Posts
- 33,582
- Vote Rating
- 433
Thanks for the report! I have opened a bug in our bug tracker.
You found a bug! We've classified it as
EXTJSIV-7284
.
We encourage you to continue the discussion and to find an acceptable workaround while we work on a permanent fix.


Reply With Quote