View Full Version : Simple Reload of ComboBox

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 = [
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 = [
['s1', '1'],
['s2', '2'],
['s3', '3']

var Sds = new Ext.data.SimpleStore({
fields: ['Description', 'Value'],
data : xxx

Above does not work, just clears out the combobox

Any help would be appreciated, thanks.

31 Aug 2007, 7:56 AM
loadData() does not load another store, but a block of data. See http://extjs.com/deploy/ext/docs/output/Ext.data.Store.html#loadData

See also:



Your code should be:


Note: When posting code please use the CODE tags - select your code and click # in the editor bar.

14 Mar 2008, 4:37 AM
// cria o vetor que ir