Extjs--checkbox,选中与不选中
2016-07-01 15:26
453 查看
if(!this.status){ Ext.getCmp("southPanelCheckbox").setValue(true); var btn=document.getElementById("southLeftButtonArray0").getElementsByTagName("button")[0]; btn.style["background-color"]="rgb(38,182,142)"; btn.style.border="1px solid #FFF"; btn.style.color="white"; this.status=true; Ext.getCmp("southPanelCheckbox").status=true; } else{ Ext.getCmp("southPanelCheckbox").setValue(false); var btn=document.getElementById("southLeftButtonArray0").getElementsByTagName("button")[0]; btn.style["background-color"]="white"; btn.style.border="1px solid #6A6A6A"; btn.style.color="black"; this.status=false; Ext.getCmp("southPanelCheckbox").status=false; }
Ext.getCmp("southPanelCheckbox").setValue(true);是让这个按钮被选中。
Ext.getCmp("southPanelCheckbox").setValue(false);是让这个按钮不被选中。
对checkbox也可以给它添加click事件的。
其他的详见ext-all.js文件
相关文章推荐
- listview滚动到底部可以继续加载,结合json解析
- 使用 JS 复制文本内容
- 说说JSON和JSONP,也许你会豁然开朗
- Js 操控 Cookie(简单实用)
- 文件上传的渐进式增强
- javascript学习资源
- ajaxfileupload回到json带<pre>
- json字符串转json对象
- js frameset 父子页面互动
- js去空格
- 一段JS 分时显示 欢迎信息
- js实现刮刮卡效果
- JS怎样捕获浏览器关闭时间弹出自定义对话框
- JavaScript中获得指定日期字符串问题
- JavaScript中继承方式详解
- js简单的弹出框有关闭按钮
- ArcGIS Engine中 IGeometry和Json字符串的相互转换
- C# 生成Json数据
- JavaScript之原型模式
- 在html的JavaScript部分计算,保留小数点后面的位数