title: ExtJS 6 Bind grid selection to the viewModel
body: <p>I want to bind grid selection to the viewModel.</p>
  
  <p>In <a href="https://stackoverflow.com/a/36040368">this answer</a> there is an example for single selection mode:</p>
  
  <pre><code>viewModel: {
      formulas: {
          selection: {
              bind: '{g.selection}',
              get: function (selection) {
                  return selection;
              }
          }
      }
  }
  </code></pre>
  
  <p>But if I use:</p>
  
  <pre><code>selModel: {
      selType: 'rowmodel',
      mode: 'MULTI'
  },
  </code></pre>
  
  <p>viewModel <code>selection</code> contains only last selected record and I expect both records in array, like <code>.getSelection()</code> returns. Any suggestions?</p>
  
  <p>Check <a href="https://fiddle.sencha.com/#view/editor&amp;fiddle/27kj" rel="nofollow noreferrer">this fiddle</a>.</p>
  
  <p><em>Of course, I can manually set viewModel attribute value (for example as in <a href="https://stackoverflow.com/a/46528485/2667065">this answer</a>), but I ask how this can be achieved through the binding mechanism.</em></p>