Dojo : how to set to disable new button

user1739825 picture user1739825 · Jul 19, 2013 · Viewed 20k times · Source

Hi I have trouble setting the new button to disabled. I am using Dojo 1.8

See my code below:-

require(["dojo/parser", "dijit/layout/BorderContainer",
"dijit/form/Button","dojo/on","dijit/form/Select",
"dojo/store/Memory", "dojo/request","dojo/domReady!"
],
function(parser, BorderContainer, Button, on, Select, Memory, request)
{

var btn4 = new Button // Button, not button
({
    label: "Number of cards",
    this.set("disabled", false) // This code that disables the button
    },"btn4"); 
btn4.startup();
})

I cannot find help in Dojo or google for it.

Answer

Web Devie picture Web Devie · Jul 22, 2013

In Dojo many things are other as you would expect.

Button have method setDisabled:

btn4.setDisabled(true) // disable
btn4.setDisabled(false) // enable