0
votes

To binding between a grid and a form I use something like:

viewModel: {
    type: 'viewermodel'
},

items: [{
    xtype: 'grid',
    title: 'Grid: click on the grid rows',
    itemId:'myGridItemId',
    flex: 1.2,
    margin: '0 10 0 0',
    bind:{
        store:'{mystore}',
        selection:'{users}'
    },
    columns: [
        { text: 'Name',  dataIndex: 'name', flex:0.5 },
        { text: 'Email', dataIndex: 'email', flex: 1 },
        { text: 'Cars', dataIndex: 'cars', flex: 1 }
    ]
},

FIDDLE: https://fiddle.sencha.com/#fiddle/1is6&view/editor

Problem: the store is not in a viewmodel but in the store's app folder (App.store.MyStore).

Is there any way, in this case, of binding selection: '{users}' from record grid to form fields? Something like:

store:'MyStore',
bind:{    
    selection:'{users}'
},
1

1 Answers

2
votes

You need to add MyStore to your application's store config.

Here's the updated fiddle. You'll see in Ext.application I've added stores: ['MyStore']