title: extJS comboBox. Dynamic data load
body: <p>I wrote the following implementation of combo box with dynamic data upload.</p>
  
  <p><strong>Code</strong></p>
  
  <pre><code>Loyalty.tools.DictionaryComboBox = Ext.extend(Ext.form.ComboBox,
  
   {
      defaultConfig:{
  
          defaults:{
              labelWidth:150
          },
          displayField:'value',
          valueField:'key',
          forceSelection:true,
          mode:'local',
          typeAhead: true,
          triggerAction: 'all',
          selectOnFocus:true
      },
  
      constructor:function (config) {
          Ext.apply(config, this.defaultConfig);
          config['store'] = new Ext.data.Store({
              fields:['key', 'value', 'description'],
              proxy:{
                  type:'ajax',
                  url:config.dictionaryPath + '/' + config.dictionaryName
              }
          });
          Loyalty.tools.DictionaryComboBox.superclass.constructor.call(this, config);
      }
  
  }
  
   );
  </code></pre>
  
  <p>and I use it the following way</p>
  
  <pre><code>            new Loyalty.tools.DictionaryComboBox({
                  fieldLabel: Loyalty.messages['company.grid.filter.forma'],
                  dictionaryPath: config.dictionaryPath,
                  dictionaryName: 'forma',
                  name: 'forma',
                  id:'forma',
                  allowBlank:true,
                  labelWidth:config.labelWidth
              }),
  </code></pre>
  
  <p>I have the two problems
  1) How can I get the list data when combo box is loading( rather than on the first click)
  2) and if I'm putting a key in the combo box so that it immediately display the desired value?</p>