嗨,我将新按钮设置为禁用.我正在使用Dojo 1.8
请参阅下面的代码: -
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();
})
Run Code Online (Sandbox Code Playgroud)
我无法在Dojo或google中找到帮助.
Web*_*vie 16
在道场,许多事情都是你所期望的.
按钮有方法setDisabled:
btn4.setDisabled(true) // disable
btn4.setDisabled(false) // enable
Run Code Online (Sandbox Code Playgroud)
首先,尝试this.set()在dijit的参数列表中调用没有意义,因为还没有创建dijit.其次,dijit的第一个参数始终是具有键/值对的标准javascript对象.尝试在对象声明的中间插入函数调用只是代码本身的语法错误.
最后,根本不需要尝试使用dijit的setter.只需disabled: true在你的参数列表中设置Buttondijit即可.
var btn4 = new Button({
label: "Number of cards",
disabled: true,
}, "btn4");
Run Code Online (Sandbox Code Playgroud)
看到这个小提琴.
| 归档时间: |
|
| 查看次数: |
19066 次 |
| 最近记录: |