title: Magento : Can't rewrite Widget Grid for optimize filtering
body: <p>I working on <a href="http://magentocommerce.com/" rel="nofollow">Magento</a> framework.</p>
  
  <p>I want to rewrite <code>Mage_Adminhtml_Block_Widget_Grid</code> to optimize search filtering.</p>
  
  <p>I add rewrite block on my <code>etc/config.xml</code> and name block as <code>grid_search_date</code>.</p>
  
  <pre><code>&lt;config&gt;
    &lt;global&gt;
      &lt;helpers&gt;
        &lt;core&gt;
          &lt;rewrite&gt;
            &lt;data&gt;Jdate_Format_Helper_Data&lt;/data&gt;
          &lt;/rewrite&gt;
        &lt;/core&gt;
      &lt;/helpers&gt;
      &lt;blocks&gt;
        &lt;grid_search_date&gt;
          &lt;rewrite&gt;
            &lt;widget_grid&gt;Jdate_Format_Block_Widget_Grid&lt;/widget_grid&gt;
          &lt;/rewrite&gt;
        &lt;/grid_search_date&gt;
        &lt;topmenu_admin_time&gt;
          &lt;rewrite&gt;
            &lt;widget_grid_column_renderer_date&gt;Jdate_Format_Block_Widget_Grid_Column_Renderer_Date&lt;/widget_grid_column_renderer_date&gt;
          &lt;/rewrite&gt;
        &lt;/topmenu_admin_time&gt;
  
      &lt;/blocks&gt;
    &lt;/global&gt;
  &lt;/config&gt;
  </code></pre>
  
  <p>You can see <code>Jdate_Format_Block_Widget_Grid</code> want to rewrite <code>widget_grid</code> and we move to this file</p>
  
  <pre><code>class Jdate_Format_Block_Widget_Grid extends Mage_Adminhtml_Block_Widget_Grid
  {   
      protected function _addColumnFilterToCollection($column)
      {   
  
          if ($this-&gt;getCollection()) {
              $field = ( $column-&gt;getFilterIndex() ) ? $column-&gt;getFilterIndex() : $column-&gt;getIndex();
              if ($column-&gt;getFilterConditionCallback()) {
                  call_user_func($column-&gt;getFilterConditionCallback(), $this-&gt;getCollection(), $column);
              } else {
                  $cond = $column-&gt;getFilter()-&gt;getCondition();
                  die(var_dump($cond["orig_from"]));
                  die(var_dump($cond["orig_to"]));
                  if ($field &amp;&amp; isset($cond)) {
                      $this-&gt;getCollection()-&gt;addFieldToFilter($field , $cond);
                  }
              }
          }
          return $this;
      }   
  }
  </code></pre>
  
  <p>But nothing happen. But if I change directly <code>Widget_Grid</code> file to this, it works.</p>
  
  <p>Any idea?</p>