Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Dojo : how to set to disable new button

Tags:

button

dojo

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.

like image 417
user1739825 Avatar asked Jul 19 '13 03:07

user1739825


People also ask

How do you disable a button in Dojo?

Just set disabled: true in your argument list to the Button dijit. var btn4 = new Button({ label: "Number of cards", disabled: true, }, "btn4");


1 Answers

In Dojo many things are other as you would expect.

Button have method setDisabled:

btn4.setDisabled(true) // disable
btn4.setDisabled(false) // enable
like image 155
Web Devie Avatar answered Oct 05 '22 14:10

Web Devie