I m trying to set a on click event dynamically to a dijit/form/Button. But, the method I m trying doesn't seem to work.
<button id = "newActButton" data-dojo-type="dijit/form/Button"
type = "button"
data-dojo-props="iconClass: 'newActButtonIcon', label: 'New Act'"></button>
dijit.byId("newActButton").set("onClick", newActButtonOnClick());
I have a function newActButtonOnClick(), which I want to fire.
You may try something like this:
require(["dojo/on", "dojo/dom", "dojo/domReady!"],
function(on, dom) {
var newActButton = dom.byId("newActButton");
on(newActButton, "click", newActButtonOnClick);
});