Extjs--checkbox,选中与不选中
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文件
还没有评论,来说两句吧...