sberringer
31 Aug 2007, 7:30 AM
I have scoured the forum, but have not really found an answer for this simple task. I have a combo box, created at page load, that needs to be reloaded with different data on some event.
// Initial load looks like:
var StudentDataSrc = [
['test','0']
];
var StudentDataStore = new Ext.data.SimpleStore({
fields: ['Description', 'Value'],
data : StudentDataSrc
});
var ComboStudents = {store: StudentDataStore, displayField:'Description', valueField:'Value', typeAhead:true, mode:'local', allowBlank:false, forceSelection:true, selectOnFocus:true, emptyText : 'Select a student...'};
// After an event (blur on text field) I am trying to reload with another set of data:
var xxx = [
['S0','0'],
['s1', '1'],
['s2', '2'],
['s3', '3']
];
var Sds = new Ext.data.SimpleStore({
fields: ['Description', 'Value'],
data : xxx
});
fieldStudents.store.loadData(Sds);
Above does not work, just clears out the combobox
Any help would be appreciated, thanks.
// Initial load looks like:
var StudentDataSrc = [
['test','0']
];
var StudentDataStore = new Ext.data.SimpleStore({
fields: ['Description', 'Value'],
data : StudentDataSrc
});
var ComboStudents = {store: StudentDataStore, displayField:'Description', valueField:'Value', typeAhead:true, mode:'local', allowBlank:false, forceSelection:true, selectOnFocus:true, emptyText : 'Select a student...'};
// After an event (blur on text field) I am trying to reload with another set of data:
var xxx = [
['S0','0'],
['s1', '1'],
['s2', '2'],
['s3', '3']
];
var Sds = new Ext.data.SimpleStore({
fields: ['Description', 'Value'],
data : xxx
});
fieldStudents.store.loadData(Sds);
Above does not work, just clears out the combobox
Any help would be appreciated, thanks.