title: Simultaneous selection of similar records from two grids in two tab panels?
body: <blockquote>
    <p>*<em>I want to select similar records from grid1 and grid2 at the same time record is selected in grid1. *</em></p>
  </blockquote>
  
  <p>For example say that if emp_id 1 has dept_id A and B and emp_id 2 has dept_id C,D and E.
  A user selects dept_id D . On the back automatically, emp_id 2 and dept_id C and E should get selected.
  If user selects emp_id 1 and 2 then on the back all the five dept_id should get selected.</p>
  
  <pre><code>Adding event handler for grid : 
  
  {
   xtype : 'grid1',                                                           
   id:'accsearchgrid',
   cls:'accsearchgrid;                                                   
       listeners : {
                      select : function( thisobj, record, index, eOpts ){
                                   console.log("selected");
                                   var AccGridDetails = Ext.getCmp('accsearchgrid');//my grid1
                                   var GrpGridDetails = Ext.getCmp('grpsearchgrid');//my grid2
                                   var Accselection = AccGridDetails.getSelectionModel();
                                   var Grpselection = GrpGridDetails.getSelectionModel();
                                   var Accstore = Ext.getStore('AccDetailsStore');//grid1 store
                                   var Grpstore = Ext.getStore('GrpDetailsStore');//grid2 store
                                   items=[];
                                   for(i=0;i &lt; Accstore.getCount();i++)
                                   {                  
                                      if(Accselection.isSelected(i))      
                                      {
                                         items.push({ 
                                            "prbalgrp"      : Accstore.getAt(i).data.prbalgrp //field which is same in both the grids.
                                          });
                                      }
                                   }
                                   var EncodeItems = Ext.encode(items);
                                   for(j=0; j &lt; items.length ;j++)
                                   {
                                      for(i=0;i &lt; Grpstore.getCount();i++)
                                      {
                                        console.log("items[j]pppp--&gt;"+ items[j].prbalgrp);
                                        if(Grpstore.getAt(i).data.prbalgrp == items[j].prbalgrp){
                                            Ext.getCmp('grpsearchgrid').getSelectionModel().select(i); // error for first time  afterwards their is no problem but only one single record is seleted
                                        }
                                      }   
                                    }  
                                  }   
                            }
              },
  </code></pre>
  
  <blockquote>
    <p>I am able to select only a single record in other grid.
    But I beginning error I am getting is :Uncaught TypeError: Cannot call method 'getAt' of undefined ext-all-debug.js:59297
    Second time,I mean after selecting second record it is working fine.
    Please help resolve this.</p>
  </blockquote>