Extjs--checkbox,选中与不选中

野性酷女 2022-09-22 15:47 290阅读 0赞
  1. if(!this.status){
  2. Ext.getCmp("southPanelCheckbox").setValue(true);
  3. var btn=document.getElementById("southLeftButtonArray0").getElementsByTagName("button")[0];
  4. btn.style["background-color"]="rgb(38,182,142)";
  5. btn.style.border="1px solid #FFF";
  6. btn.style.color="white";
  7. this.status=true;
  8. Ext.getCmp("southPanelCheckbox").status=true;
  9. }
  10. else{
  11. Ext.getCmp("southPanelCheckbox").setValue(false);
  12. var btn=document.getElementById("southLeftButtonArray0").getElementsByTagName("button")[0];
  13. btn.style["background-color"]="white";
  14. btn.style.border="1px solid #6A6A6A";
  15. btn.style.color="black";
  16. this.status=false;
  17. Ext.getCmp("southPanelCheckbox").status=false;
  18. }
  19. Ext.getCmp("southPanelCheckbox").setValue(true);

是让这个按钮被选中。

  1. Ext.getCmp("southPanelCheckbox").setValue(false);

是让这个按钮不被选中。

对checkbox也可以给它添加click事件的。

其他的详见ext-all.js文件

发表评论

表情:
评论列表 (有 0 条评论,290人围观)

还没有评论,来说两句吧...

相关阅读

    相关 切换选中

     需求: 切换选中         1.1 点击全选按钮 将每一个复选框的状态都变成选中         1.2 点击不选按钮 将每一个复选框的状态都变成不选中    

    相关 选中

      现象:html中可能有些地方不想让用户复制文字,或是用a标签做了个点击按钮,点快的时候文字会被选中,很丑,这个时候可以使用下面的方案禁止文字选中。 原因:鼠标点快了文字