title: Sencha Extjs - How to use grid getRowClass() dynamically from Controller
body: <p>I have a checkbox column in my grid that displays Yes/No based on checkbox selection. </p>
  
  <p><strong>Requirement:</strong> 
  If checkbox value == Yes, change row color Green
  Else Leave as is (default).</p>
  
  <p><strong>Steps I have taken so far:</strong> 
  On Ext.grid.View set the getRowClass function, something like this:</p>
  
  <pre><code> viewConfig: {
   getRowClass: function(record, rowIndex, rowParams, store) {
   if (record.get('isApproved') == true)
     {
       return 'highlight-rowgreen';
     }                           
   },
  </code></pre>
  
  <p>This works perfectly fine. <strong>However I want achieve this in a store.sync callback</strong> which is not happening at the moment. There is no error, nothing. Just doesnt work.</p>
  
  <pre><code>var store = Ext.getStore('MyApp.MyStore');
          store.proxy.url = MYAPP.globals.url + "myapplication/" + branchNo + "/event/" + branchEventId;
          store.sync({
              scope: this,
              callback:function (records, operation, success) {
                  if(records.proxy.reader.rawData.success){
                  // Success. Set the rows color to green if not already done.                    
                     alert('Update Completed');
                     eventsGrid.getView().getRowClass = function(record, rowIndex, rowParams, store){
                         console.log('I am here');
                         if (record.get('isApproved') == true)
                         {
                          return 'highlight-rowgreen';
                         }
                        };
                    }
                    else{
                       alert('Update failed');                   
                    }
                  }
          });
  </code></pre>
  
  <p>What I cant see is my console log <strong>"I am here"</strong>. I can see the Alert message alright.</p>
  
  <p>I have tried other solutions as well like <a href="https://stackoverflow.com/questions/14072153/how-to-dynamically-change-the-getrowclass-function-on-an-extjs-gridpanel-viewcon">this</a> but not happening.</p>
  
  <p>Any help is appreciated. Thanks</p>