proximus
proximus

Reputation: 689

dojo.connect event object undefined

I connected a function via dojo.connect to a dojox.layout.ContentPane according to Dojo's documentation:

dojo.connect(cp, 'onHide', function(e) {
    alert('test');
    console.log(e);
});

I expect argument e to be the triggered event object, but console output is undefined. What's the problem here?

Upvotes: 0

Views: 412

Answers (1)

Craig Swing
Craig Swing

Reputation: 8162

The answer depends on what you are connecting to.

  • If you are connecting to a dom event (which your example is not), then you will get the dom event object passed into your function.
  • If you are connecting to a function in a javascript object (which is what your example is), then the arguments passed into the function that is connected to (onHide) will be passed into your function. I am guessing that there are no arguments that get passed into the onHide function.

Note: dojo.connect has been replaced with dojo/on.

Upvotes: 1

Related Questions