title: How do I call a function from innerhtml of an ExtJS component
body: <p>I have this component in ExtJS to which I am setting some HTML and there is an onclick inside it that I have to call. So How do I call a javascript function from HTML of an Extjs component</p>
  
  <p>This is my code:</p>
  
  <p>for the component:</p>
  
  <pre><code>  collapsed: true,
                      layout: 'fit',
                      items: [
                          {
                              xtype: 'component',
                              itemId: 'requirementHeaderViewID-' + i,
                              html: arrReqTplTest
  
                          }
  }
  );
  </code></pre>
  
  <p>This is the HTML:</p>
  
  <pre><code>arrReqTplTest = ['&lt;div class="wrap-req"&gt;&lt;table&gt;&lt;tr&gt;&lt;th class="wrap-req"&gt;' +
                  'NAME  ' +
                  '&lt;img src="resources/images/arrow-bottom-1-512.png" width="10px" height="10px" onclick="{[this.sortStore();]}"/&gt;' +
                  '&lt;/th&gt;&lt;th class="wrap-req"&gt;CATEGORY ' +
                  ' &lt;img src="resources/images/arrow-bottom-1-512.png" width="10px" height="10px" onclick="sortStore();"/&gt;' +&lt;/th&gt;'&lt;/table&gt;',
                  &lt;/th&gt;&lt;/tr&gt;&lt;/table&gt;&lt;/div&gt;
  </code></pre>
  
  <p>This is the function lets say:</p>
  
  <pre><code>sortStore: function(){
  alert('xyz');
  }
  </code></pre>
  
  <p>I have shortened the code for your ease, so might have syntax errors but rest assured everything fine but I just need to know how to call a JS function from HTML that is part of Ext.JS component after the page is loaded. </p>