Quantcast
Viewing all articles
Browse latest Browse all 171

DwtTree.addSelectionListener fires twice for clicks - WHY?

While amending the tree view, I found out that the selections fire twice for 2nd, 3rd... ciick on any item in the tree list. The first click, however, just fires once.

Code:

var i=1;
    this._treeclick = function() {
        console.log('Treeclick ' + i++);
        console.log(arguments);
    }
    linkTree.addSelectionListener(
        new AjxListener(this, this._treeclick, {})
    );

The function _treeclick will be executed once for the first click, and then twice for each click from there on. All of the events are "mouseup" and I can not distinguish between them -- they are the same.

Is this a bug? This was tested against 7.2.1 Network edition and against ZimbraDesktop 7.2.1.

Also, I would only like to handle clicks, but if the DwtTreeItem has set selectable=false, then I can not catch the click events (even by using other listeners (addTreeListener, addListener).

Regards,
Miha.

Viewing all articles
Browse latest Browse all 171

Trending Articles