Dario Dario - 1 year ago 86
Javascript Question

Dojo's dojo/method programmatically?

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

Answer Source

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
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download