title: Add a button to an ag-grid column header
body: <p>I have a default ag-grid header, that is configured just like I need it. It is not movable, it is pinned and stuff like that. Now I have the challenge that seemed pretty simple but perhaps is the hardest thing to do using ag-grid - just spend the last two days on this...  </p>
  
  <p>I just want to add one little button that I can react on in my angular component.</p>
  
  <p>I tried it with <a href="https://www.ag-grid.com/javascript-grid-column-header/" rel="nofollow noreferrer">Header Templates</a>: I can add a button here but I am not able to react on the click event.</p>
  
  <p>Then I tried <a href="https://www.ag-grid.com/javascript-grid-header-rendering/" rel="nofollow noreferrer">Header Components</a> but then, I have to take care of all the different features like sorting, filtering, menu, styling, ... Result: Suddenly, I can move the former pinned column around, it looks different than the other columns and and and. Just hell! </p>
  
  <p>What is the easiest way to add a button to one column header but keep the styling and functionality just as it is? </p>
  
  <p><strong>UPDATE</strong>
  After playing around with the ag-grid demo code from ag-grid, trying to use Header Components, I am back trying to use Header Templates. My current solution is to use the template to add my buttons and to wire up the events in code on the GridReady event. Something like:</p>
  
  <pre><code>&lt;div class="ag-cell-label-container" role="presentation"&gt;
      &lt;span ref="eMenu" class="ag-header-icon ag-header-cell-menu-button"&gt;&lt;/span&gt;
      &lt;div ref="eLabel" class="ag-header-cell-label" role="presentation"&gt;
          &lt;div&gt;
              &lt;span id="ID1"&gt;&lt;i class="someclass1"&gt;&lt;/i&gt;&lt;/span&gt;
              &lt;span id="ID2"&gt;&lt;i class="someclass2"&gt;&lt;/i&gt;&lt;/span&gt;
          &lt;/div&gt;
  
          &lt;span ref="eSortOrder" class="ag-header-icon ag-sort-order"&gt;&lt;/span&gt;
          &lt;span ref="eSortAsc" class="ag-header-icon ag-sort-ascending-icon"&gt;&lt;/span&gt;
          &lt;span ref="eSortDesc" class="ag-header-icon ag-sort-descending-icon"&gt;&lt;/span&gt;
          &lt;span ref="eSortNone" class="ag-header-icon ag-sort-none-icon"&gt;&lt;/span&gt;
          &lt;span ref="eText" class="ag-header-cell-text" role="columnheader"&gt;&lt;/span&gt;
          &lt;span ref="eFilter" class="ag-header-icon ag-filter-icon"&gt;&lt;/span&gt;
      &lt;/div&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>And then to wire up the events:</p>
  
  <pre><code>const elm1: HTMLElement = document.getElementById('ID1') as HTMLElement;
  Observable.fromEvent(elm1, 'click').takeWhile(() =&gt; this._isAlive).subscribe((event: MouseEvent) =&gt; {
      event.preventDefault();
      event.stopPropagation();
      // Logic
  });
  </code></pre>
  
  <p>Seems to work but I definitely hope that there is a more professional way to do it...</p>