title: Extjs 4. combobox in grid. using index to get data
body: <p>I need my controller to load a grid with comboboxes. </p>
  
  <p>The status field (number) in the 'equipment data' should load the status field of possible states from 'equipment states' and display these in the combobox.</p>
  
  <p>When selecting a new option, the id should be saved in 'equipment data', status field. As a number.</p>
  
  <pre><code>// for store 'equipment'
  &lt;?php
  header("Content-type: application/json");
  ?&gt;
  {
      "success": true,
      "data": [
          {
              "equipment_id": 1,
              "name": "screwdriver",
              "status": 1
          }
      ]
  }
  
  
  // store 'equipmentStatus'
  &lt;?php
  header("Content-type: application/json");
  ?&gt;
  {
      "success": true,
      "data": [
          {
              "id": 1,
              "status": "available"
          },
          {
              "id": 2,
              "status": "out of stock"
          },
          {
              "id": 3,
              "status": "not available"
          }
      ]
  }
  
  // -----------------------------
  
  Ext.define('Equipment.view.EquipmentGrid', {
      extend: 'Ext.grid.Panel',
      alias: 'widget.EquipmentGrid',
  
      title: 'Equipment manager',
  
      requires: [
          'Ext.form.field.ComboBox',
          'Ext.grid.column.CheckColumn',
          'Ext.grid.plugin.CellEditing'
      ],
  
      initComponent: function () {
  
          // enable quicktips
          Ext.tip.QuickTipManager.init();
  
          this.cellEditing = new Ext.grid.plugin.CellEditing({
              clicksToEdit: 1
          });
  
          Ext.apply(this, {
  
                  plugins: [this.cellEditing],
  
                  // connect store to grid
                  store: 'Equipments',
  
                      columns: [
                      {
                          header: 'Status',
                          dataIndex: 'status',
                          editor: new Ext.form.field.ComboBox({
                              typeAhead: true,
                              triggerAction: 'all',
                              store: 'EquipmentStatus'
                          })
                      }
                  ]
      });
  
          this.callParent(arguments);
      }
  
  });
  </code></pre>