title: Populate ExtJS 3.4 combobox with local JSON data
body: <p>I'm using ExtJS 3.4 and I need to populate a combobox with the following data:</p>
  
  <pre><code>"[{"cod_domini":"1","nom_domini":"Sant Esteve de Palautordera"},{"cod_domini":"2","nom_domini":"Parc Natural del Montseny"},{"cod_domini":"5","nom_domini":"Sant Pere de Vilamajor"},{"cod_domini":"6","nom_domini":"Santa Maria i Mosqueroles"}]"
  </code></pre>
  
  <p>Which comes form a previous XMLHttpRequest, and I've got it stored in a variable so: </p>
  
  <pre><code>my_variable = "[{"cod_domini":"1","nom_domini":"Sant Esteve de Palautordera"},{"cod_domini":"2","nom_domini":"Parc Natural del Montseny"},{"cod_domini":"5","nom_domini":"Sant Pere de Vilamajor"},{"cod_domini":"6","nom_domini":"Santa Maria i Mosqueroles"}]"
  </code></pre>
  
  <p>So, I have the following ExtJS 3.4 combobox:</p>
  
  <pre><code>cbxSelDomini = new Ext.form.ComboBox({
                              hiddenName: 'Domini',
                              name: 'nom_domini',
                              displayField: 'nom_domini',
                              valueField: 'cod_domini',
                              mode: 'local',
                              triggerAction: 'all',
                              listClass: 'comboalign',
                              typeAhead: true,
                              forceSelection: true,
                              selectOnFocus: true,
                              store: mystore
  });
  </code></pre>
  
  <p>This combobox is suposed to get data from an Ext.data.Store I named "mystore":</p>
  
  <pre><code>store: mystore = new Ext.data.Store({
                                      autoload: true,
                                      reader: new Ext.data.ArrayReader(
                                          {
                                              idIndex: 0  // id for each record will be the first element
                                          }),
                                      data: dataprova,
                                      fields: [ 
                                                          {type: 'integer', name: 'cod_domini'},
                                                          {type: 'string', name: 'nom_domini'}
                                                      ]
                                      }),
  </code></pre>
  
  <p><strong>My first problem is that at first instance, data is not loaded to dataStore, even telling explicitly: mystore.loadData(my_variable);</strong></p>
  
  <p>Can somebody try to tell me what I'm doing wrong? In fireBug I get errors like "this.data is not defined", "this.reader is not defined", or "b is undefined" and "h is undefined".</p>
  
  <p>The same kind of errors come when I change data format as javascript array like:</p>
  
  <pre><code>var dataexample = [[1, 'Sant Esteve de Palautordera'], [2, 'Parc Natural del Montseny']];
  </code></pre>
  
  <p>and call dataexample on store "data" property.</p>
  
  <p>I'm absolutely lost...</p>