Can someone help?
I have a function and I want to change the baseParams of the store without recreating the entire store if possible.
Code:
function createCombo(config) {
return new Ext.form.ComboBox(Ext.apply({
id: 'mycombo',
fieldLabel: 'Locations',
displayField: 'name',
name: 'list_ids',
mode: 'local',
triggerAction: 'all',
store: new Ext.data.JsonStore({
proxy: new Ext.data.HttpProxy({
url: 'list.php',
method: 'post'
}),
autoLoad: true,
baseParams: {Field1: '1', Field2: '2', Field3: '3'},
fields: [{name: 'id'}, {name: 'name'}],
id: 'id',
root: 'Records'
})
}, config));
};
I realize this will not work, but could use some help. How do I pass the new baseParams in the function?
Code:
createCombo({
id: 'mynewcombo',
baseParams: {Field1: '99', Field2: '100', Field3: '101'}
})
Thanks, Marty
I changed this line in the function
From:
Code:
baseParams: {Field1: '1', Field2: '2', Field3: '3'},
To:
Code:
baseParams: config.baseParams || {Field1: '1', Field2: '2', Field3: '3'},