Im attempting to alter the search options in a Ext.view.MultiSelector component based on a drop down selection, however whatever I try to do to update the search options is not reflected in the UI. Below is a basic example of what I'm trying to do.
I'm not sure if there is a function I'm not calling, or if the search options are just never re-loaded from the store once the element is drawn to the canvas?
this.multiSelectorObj = Ext.create('Ext.view.MultiSelector', {
valueField: 'id',
displayField: 'name',
showDefaultSearch: true,
plusButtonType: 'add',
hideHeaders: true,
colspan: 2,
search: {
xtype: 'multiselector-search',
store: {
type: 'store',
fields: ['id', 'name'],
autoload: true,
data: [{ id: 1, name: 'Option 1 -- I want to change this' }]
}
},
showRemoveButton: true,
columns: [{
text: "Name",
dataIndex: "name",
flex: 1
}]
}
);
Ext.create('Ext.form.Panel', {
renderTo: Ext.getBody(),
items: [
{xtype: 'combobox',
fieldLabel: 'Choose State',
store: {
fields: [ 'id', 'name' ],
data: [
{ id: 1, name: 'Set 1' },
{ id: 2, name: 'Set 2' }
]
},
queryMode: 'local',
displayField: 'name',
valueField: 'id',
listeners: {
scope: this,
'change': function(scope, newVal, oldVal, eOpts) {
//Attempting now to have a different set of options to choose from in the
//MultiSelector
//But nothing seems to work
var search = this.multiSelectorObj.getSearch();
search.data = [{id: 1, name: 'Option Data Set 2'}]
this.multiSelectorObj.setSearch(search);
//Nor does setting a new search store like this
this.multiSelectorObj.getSearch().store = Ext.create('Ext.data.Store', {
data:[{id:1, name:'New Opt'}],
fields: ['id', 'name'],
autoLoad: true
});
}
},
},
//MULTISELECTOR
this.multiSelectorObj
]
});