zoukankan      html  css  js  c++  java
  • ExtJS中,将Grid表头中的全选复选框取消复选

    今天发现公司产品用的EXTJS中使用Grid时,Grid表头中的全选复选框的选中状态不是很准确,就写了这个小扩展
    在js中加入下面方法,在需要取消全选的地方调用即可,例:Ext.getCmp('grid').unSelectAll  或 gridName.unSelectAll();
     
    // 自定义扩展:将Grid表头中的全选复选框取消复选
    Ext.grid.GridPanel.prototype.unSelectAll = function(){
        var view = this.getView();
        var sm = this.getSelectionModel();
        if(sm){
            sm.clearSelections();
            var hd = Ext.fly(view.innerHd);
            var c = hd.query('.x-grid3-hd-checker-on');
            if(c && c.length>0){
                Ext.fly(c[0]).removeClass('x-grid3-hd-checker-on')
            }
        }
    }

    对你的Grid调用unSelectAll()就可以将GridPanel表头中的全选复选框取消选中状态,具体何时调用这个方法就自己决定吧

  • 相关阅读:
    113. Path Sum II
    112. Path Sum
    111. Minimum Depth of Binary Tree
    110. Balanced Binary Tree
    Create
    SetWindowPos
    INT_PTR数据类型
    SDK介绍
    COLORREF
    setfont()函数
  • 原文地址:https://www.cnblogs.com/zouhao/p/3145362.html
Copyright © 2011-2022 走看看