在ext中如何动态设置checkbox的checked属性!

在ext中如何动态设置checkbox的checked属性!,第1张

首先你要请确保每一个checkbox都有一个唯一的id,例如:

boxLabel : '新增',

id:"add",

anchor:"50%",

name : '新增'

Ext.getCmp.setValue(true)设置为选中状态

Ext.getCmp.setValue(false)设置为未选中状态

Ext的帮助中写明了给treeStore绑定数据有两种方式,一种是root属性,code如下:

root: {

expanded: true,

text: "My Root",

children: [

{ text: "Child 1", leaf: true },

{ text: "Child 2", expanded: true, children: [

{ text: "GrandChild", leaf: true }

] }

]

}

这种方式只能添加Tree格式的数据,但是如果想要添加TreeGrid格式的数据就不行了,所以Pass。

var field = form.findById("draftkey")

field.allowBlank = true//或者等于false

form.doLayout()

你试试看。


欢迎分享,转载请注明来源:内存溢出

原文地址:https://54852.com/bake/11499639.html

(0)
打赏 微信扫一扫微信扫一扫 支付宝扫一扫支付宝扫一扫
上一篇 2023-05-16
下一篇2023-05-16

发表评论

登录后才能评论

评论列表(0条)

    保存