title: SlickGrid Check Box Select Column Plugin "Check All"
body: <p>I know I can loop through the rows and get all the id and set the rows to selected via an array.</p>
  
  <pre><code>var rows = [];
        for (var i = 0; i &lt; _grid.getDataLength(); i++) {
          rows.push(i);
        }
        _grid.setSelectedRows(rows);
  </code></pre>
  
  <p>But how can i fire the event programatically to check/uncheck the header checkbox which selects/unselects all the rows?</p>
  
  <p>This is the snippet in the plugin JS file that looks for the header box to be checked:</p>
  
  <pre><code> function handleHeaderClick(e, args) {
          if (args.column.id == _options.columnId &amp;&amp; $(e.target).is(":checkbox")) {
              // if editing, try to commit
              if (_grid.getEditorLock().isActive() &amp;&amp; !_grid.getEditorLock().commitCurrentEdit()) {
                  e.preventDefault();
                  e.stopImmediatePropagation();
                  return;
              }
  
              if ($(e.target).is(":checked")) {
                  var rows = [];
                  for (var i = 0; i &lt; _grid.getDataLength(); i++) {
                      rows.push(i);
                  }
                  _grid.setSelectedRows(rows);
              }
              else {
                  _grid.setSelectedRows([]);
              }
              e.stopPropagation();
              e.stopImmediatePropagation();
          }
      }
  </code></pre>