views:

31

answers:

1

Hello,

Is there a way to define a dojo/method programatically, in a JavaScript function? (Instead of defining it through script type="dojo/method" within a declarative widget, for example.)

Thanks!

+1  A: 

Just override it directly on a widget. For example, if you wrote dojo/method for abc, do it like that:

var myWidget = ...;
myWidget.abc = function(/* args from dojo/method */){
  // the body of dojo/method
};
Eugene Lazutkin