:: Home >>

Column resize bug with Firefox 1.0.5

Behavior of dispatchEvent method had changed in Firefox 1.0.5 causing JS exception and column resize problems in the grid control:

Error: [Exception... "Component returned failure code: 0x80070057
(NS_ERROR_ILLEGAL_VALUE) [nsIDOMEventTarget.dispatchEvent]"
nsresult: "0x80070057 (NS_ERROR_ILLEGAL_VALUE)"  location: "JS
frame :: .../runtime/lib/browsers/gecko.js :: anonymous :: line ..."  data: no]
Source File: .../runtime/lib/browsers/gecko.js Line: ...

Add the following code to your scripts to fix the problem:

if (window.HTMLElement) {

    var element = HTMLElement.prototype;

    var capture = ["click", "mousedown", "mouseup", "mousemove", "mouseover", "mouseout" ];

    element.setCapture = function(){
        var self = this;
        var flag = false;
        this._capture = function(e){
            if (flag) {return}
            flag = true;
            var event = document.createEvent("MouseEvents");
            event.initMouseEvent(e.type,
                e.bubbles, e.cancelable, e.view, e.detail,
                e.screenX, e.screenY, e.clientX, e.clientY,
                e.ctrlKey, e.altKey, e.shiftKey, e.metaKey,
                e.button, e.relatedTarget);
            self.dispatchEvent(event);
            flag = false;
        };
        for (var i=0; i<capture.length; i++) {
            window.addEventListener(capture[i], this._capture, true);
        }
    };

    element.releaseCapture = function(){
        for (var i=0; i<capture.length; i++) {
            window.removeEventListener(capture[i], this._capture, true);
        }
        this._capture = null;
    };

}

Comments

17 Sep 06
Firefox 1.0.5 resizing problem (21)
10 Jan 06
Backward compatibility JS Developer (0)
14 Sep 05
where does script go c (1)
23 Aug 05
Resizing FF 1.0.6 SEb. (0)
29 Jul 05
Weird behaviour in Firefox 1.0.5 and 1.0.6 Pablo (Zaragoza, Spain) (3)

Comments will appear on this page and in the main forum.

Documentation:

Recent changes:

2.5.0 - 2.5.3
2.5.3
2.5.0 - 2.5.2
2.5.2
2.5, 2.5.1
2.5.1
2.5
Release History
2.5
2.0.2