Sven Persson
Sven Persson

Reputation: 71

Inherit dijit.TooltipDialog

I want to to cancel an onBlur-event in order to keep a dijit.TooltipDialog open even when clicking outside it.

So my strategy was to subclass dijit.TooltipDialog and somehow take care of the event. However whatever I do the event gets propagated. The only hideous way to cancel it is by forcing some sort of null-pointer and ignore it.

dojo.provide("package.AnotherTooltipDialog");
dojo.require("dijit.TooltipDialog");

dojo.declare("package.AnotherTooltipDialog", [dijit.TooltipDialog],
{
    startup: function () {
        this.inherited(arguments);
        //this._onBlur = null;
        //this.onBlur = null;
    },
    onBlur: function () {
        //dojo.stopEvent(e); // don't have any arguments
        //this.inherited(arguments);
        //return false;
        //return -1;
        //return null;

    }
//  ,
//    _onBlur: function () {
//        dojo.stopEvent(e); // don't have any arguments
//        this.inherited(arguments);
//        return false;
//        return -1;
//        return null;
//    }
});

Any ideas?

Upvotes: 1

Views: 124

Answers (1)

Jorgeblom
Jorgeblom

Reputation: 3578

The problem here is TooltipDialog is handled as a dropDown.

You don't have to modify the tooltipDialog, but the DropDownButton instead.

I am not sure if in your application the tooltip appears from a DropDownButton, but if that was the case, override its _onBlur, like this:

return declare("package.AnotherDropDownButton", [DropDownButton], {
     _onBlur        : function() { 
         //Leave this empty
      }
}

Upvotes: 1

Related Questions