title: Grid loses (visible) selection after store-record edit and after commit
body: <p>I have a simple case where I got a grid with an attached store.</p>
  
  <p>There are 2 buttons. One with a handler that modifies the selected record. One with a handler that commits the selected record. </p>
  
  <p>When I select a record and push edit -> editing takes place selection (looks lost) if you call <code>grid.geSelectionModel().getSelection()</code> you will see that the record is still selected. It just doesn't show it that way.</p>
  
  <p>You can't select it again, you first have to select another record, and select the record back.</p>
  
  <p>Secondly when you select a record click on the commit button, the value is committed, but the selection 'appears' again as lost.</p>
  
  <p>Is this a bug? How can I fix this? I want it to keep the selection visible!</p>
  
  <p><a href="http://jsfiddle.net/Vandeplas/YZqch/5/" rel="nofollow">Here is a fiddle</a></p>
  
  <p>and here is the sample code: (I use Ext 4.1.1)</p>
  
  <pre><code>var cellEditing = Ext.create('Ext.grid.plugin.CellEditing', {
          clicksToEdit: 1
      });
  
  Ext.create('Ext.data.Store', {
      storeId: 'simpsonsStore',
      fields: ['name', 'email', 'phone'],
      data: {
          'items': [{
              'name': 'Lisa',
              "email": "lisa@simpsons.com",
              "phone": "555-111-1224"
          }, {
              'name': 'Bart',
              "email": "bart@simpsons.com",
              "phone": "555-222-1234"
          }, {
              'name': 'Homer',
              "email": "home@simpsons.com",
              "phone": "555-222-1244"
          }, {
              'name': 'Marge',
              "email": "marge@simpsons.com",
              "phone": "555-222-1254"
          }]
      },
      proxy: {
          type: 'memory',
          reader: {
              type: 'json',
              root: 'items'
          }
      }
  });
  
  Ext.create('Ext.container.Container', {
      layout: 'fit',
      renderTo: Ext.getBody(),
      items: [{
          xtype: 'grid',
          store: Ext.data.StoreManager.lookup('simpsonsStore'),
          columns: [{
              text: 'Name',
              dataIndex: 'name'
          }, {
              text: 'Email',
              dataIndex: 'email',
              flex: 1
          }, {
              text: 'Phone',
              dataIndex: 'phone'
          }],
          height: 200,
          buttons: [{
              text: 'commit selection',
              handler: function(){
                  this.up('grid').getSelectionModel().getSelection()[0].commit();
              }
          },{
              text: 'set selection name to maggy',
              handler: function(){
                  this.up('grid').getSelectionModel().getSelection()[0].set('name', 'Maggy');
              }
          }]
      }]
  });​
  </code></pre>
  
  <p><strong><em>UPDATE:</em></strong></p>
  
  <p>I reported it on the <a href="http://www.sencha.com/forum/showthread.php?244974-Grid-loses-%28visible%29-selection-after-store-record-edit-and-after-comit&amp;p=895406#post895406" rel="nofollow">sencha forum</a>. Mitchel Simoens told me it's fixed in Ext 4.1.2. Too bad it's a 'Support subscriber only' version..</p>
  
  <p><strong><em>UPDATE:</em></strong></p>
  
  <p>I'm locating the issue to try and fix it. I believe the issue is located in the Ext.view.Table class in onUpdate method, more precise around this piece of code:</p>
  
  <pre><code>if (oldRowDom.mergeAttributes) {
      oldRowDom.mergeAttributes(newRow, true);
  } else {
      newAttrs = newRow.attributes;
      attLen = newAttrs.length;
      for (i = 0; i &lt; attLen; i++) {
          attName = newAttrs[i].name;
          if (attName !== 'id') {
             oldRowDom.setAttribute(attName, newAttrs[i].value);
          }
      }
  }
  </code></pre>
  
  <p>Is it a bad idea to just leave this piece of code out? I commented it out it seems like it's working now, but won't it break some other functionality? <a href="http://jsfiddle.net/Vandeplas/YZqch/10/" rel="nofollow">http://jsfiddle.net/Vandeplas/YZqch/10/</a></p>