code: function(headerCt, header, e) {
          if (header.isCheckerHd) {
              e.stopEvent();
              var me = this,
                  isChecked = header.el.hasCls(Ext.baseCSSPrefix + 'grid-hd-checker-on');
                  
              // Prevent focus changes on the view, since we're selecting/deselecting all records
              me.preventFocus = true;
              if (isChecked) {
                  me.deselectAll();
              } else {
                  me.selectAll();
              }
              delete me.preventFocus;
          }
      }
docs: Toggle between selecting all and deselecting all when clicking on
  a checkbox header.