加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 百科 > 正文

Dojo:如何设置禁用新的按钮

发布时间:2020-12-16 22:02:51 所属栏目:百科 来源:网络整理
导读:嗨,我将设置新的按钮设置为禁用. 我正在使用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
嗨,我将设置新的按钮设置为禁用.
我正在使用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();
})

我在Dojo或谷歌找不到帮助.

首先,尝试在dijit的参数列表中调用this.set()没有意义,因为还没有创建dijit.其次,dijit的第一个参数始终是带有键/值对的标准JavaScript对象.尝试在对象声明的中间插入函数调用只是代码本身的语法错误.

最后,没有必要尝试使用dijit的设置器.只需将禁用:在参数列表中的true为Button dijit.

var btn4 = new Button({
    label: "Number of cards",disabled: true,},"btn4");

看这个Fiddle.

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读