Hi,

I have two combox, one parent (AssetClass) and other child: strategy. Upon selecting value from the parent combobox, the child will display the relevant values.

Upon adding a new row, when I select a value from the parent combobox, the child combo box, shows the correct text. When I add another record, and if I go back to the previous record, the child combox displays Id instead of the displayField.

Could someone please let me know what I am doing wrong??

Combo box code:


//PARENT COMBO BOX DATA
var assetClassArray = [
['Alternative'],
['Equity'],
];

//CHILD COMBO BOX DATA

var strategyArray = [
[['AIP Multi-Strategy Hedge (Italy)','N10000178']
,['Alpha Advantage - European Bond','N10000180']
,['Alpha Advantage - European Equity','N10000177']
],
[['Diversified Portfolio Allocation - Alternatives','N10000152']
,['Dividend Value','N10000179']
,['Disciplined Equity Small Cap Value','N10000153']
,['Fiduciary','T40000262']
];

//Parent context
assetClassContext = new Ext.data.Store({
proxy: new Ext.data.MemoryProxy(assetClassDataStore),
reader: new Ext.data.ArrayReader({ id: 1}, [
{name: 'description'},"
{name: 'id'}
])});
assetClassContext.load();

//Child context
var strategyContext = new Ext.data.Store({
proxy: new Ext.data.MemoryProxy(strategyArray[0]),
reader: new Ext.data.ArrayReader({ id: 1}, [
{name: 'description'}
{name: 'id'}
])});

strategyContext.load();

//Had to declare another datastore so that the
//data is populated correctly upon initally load for the renderer
var strategyDS = new Ext.data.Store({
proxy: new Ext.data.MemoryProxy(strategyDataStore),
reader: new Ext.data.ArrayReader({ id: 1}, [
(name: 'description'},
{name: 'id'}
])});
strategyDS.load();

var assetClassCmb = new Ext.form.ComboBox({
typeAhead: true,
triggerAction: 'all',store: assetClassContext, lazyRender:true,
displayField: 'description',valueField: 'id',data: assetClassDataStore
});

var strategyCmb = new Ext.form.ComboBox({
typeAhead: true,
triggerAction: 'all',store: strategyContext, lazyRender:true,
displayField: 'description',valueField: 'id'
});


var colModel = new Ext.grid.ColumnModel([
{header: '<input type=\"checkbox\" name=\"chkBox\" onclick=\"toggleCheckboxes(&quot;ConsultingFirm_&quot;, this.checked);repaintNav();\" class=\"gridChkbx\"/>',width:30,sortable:false,dataIndex:'agcisCfId', renderer: chkBoxColumn},

{header: 'Asset Class',width:120,sortable: true,dataIndex: 'assetClassId',
editor: new Ext.grid.GridEditor(assetClassCmb)
, renderer: assetClassRenderer},

{header: 'Strategy',width:230,sortable: true,dataIndex: 'strgyId',
editor: new Ext.grid.GridEditor(strategyCmb)
renderer: strategyRenderer}
]);

// attach a listener to monitor selection changes and reload startegy store object
assetClassCmb.on('select', function(cmb, data, idx){ ");
strategyCmb.store.proxy = new Ext.data.MemoryProxy(strategyArray[idx]);
strategyCmb.store.reload();
});