title: Magento Grid - sortering and filtering works incorrectly after joining flat table to EAV
body: <p>I have 2 custom colletions. Usual collections with flat data.
  I need to join them to customers select. It works fine with innerJoin, but filtering and sorting for joined fields doesn't work. How can I solve this?</p>
  
  <p>_prepareCollection() example</p>
  
  <pre><code>$collection = Mage::getResourceModel('customer/customer_collection')
      -&gt;addNameToSelect()
      -&gt;addAttributeToSelect('email');
  
  $collection
      -&gt;getSelect()
      -&gt;joinInner(array('my_table' =&gt; $collection-&gt;getTable('my/table')), 'e.entity_id = my_table.customer_id', array('custom_field' =&gt; my_table.custom_field))
      -&gt;joinInner(array('my_table1' =&gt; $collection-&gt;getTable('my/table1')), 'my_table1.other_id = my_table.id', array('custom_field1' =&gt; my_table1.custom_field));
  
  $this-&gt;setCollection($collection);
  return parent::_prepareCollection();
  </code></pre>
  
  <p>So, sorting and filtering will not work for custom_field and custom_field1</p>
  
  <p>Add column call:</p>
  
  <pre><code>$this-&gt;addColumn('custom_field',
          array(
              'header'=&gt;$this-&gt;__('Shopping club name'),
              'index'=&gt;'custom_field',
              'filter_index'=&gt;'my_table.custom_field',
      ));
  </code></pre>
  
  <p>While filtering I get fatal error:</p>
  
  <pre><code>Call to a member function getBackend() on a non-object
  </code></pre>
  
  <p>Sorting doesn't work, no errors shown</p>
  
  <p>'filter_index' works fine if you join flat to flat tables. But here flat is joined to EAV.</p>