I have a simple grid, with a widget column that displays a combobox. I would like to set the combo store depending on its bound record.
Here is a very simple fiddle that demonstrates my problem: https://fiddle.sencha.com/#fiddle/jb7
And here is the same code:
var userStore = Ext.create('Ext.data.Store', {
fields: ['firstname', 'ownedCars'],
data : [{
"firstname": "jean",
"ownedCars": [{
"id": 12,
"name": "punto"
},{
"id": 28,
"name": "civic"
}]
}, {
"firstname": "michel",
"ownedCars": [{
"id": 23,
"name": "polo"
},{
"id": 58,
"name": "bmw"
}]
}]
});
Ext.create('Ext.grid.Panel', {
renderTo: Ext.getBody(),
store: userStore,
width: 500,
autoHeight: true,
title: 'Users cars grid',
columns: [{
text: 'Firstname',
flex: 1,
dataIndex: 'firstname'
},{
xtype: 'widgetcolumn',
text: 'Cars',
flex: 1,
dataIndex: 'ownedCars',
widget: {
xtype: 'combo',
displayField: 'name',
valueField: 'id'
// store: How to set the store of the combo depending on the record
}
}]
});
Thanks in advance !!