title: extjs 4 : filling model data into combobox from PHP + MySql
body: <pre><code>Ext.define('User', {
       extend: 'Ext.data.Model',
       fields: [
           {name: 'DeviceID', type: 'string'},
           {name: 'VehicleNo',  type: 'string'}
       ]
   });
  
      var store1 = new Ext.data.JsonStore({
      // store configs
      model: 'User',
      storeId: 'myStore',
      proxy: {
          type: 'ajax',
          url: 'combobox.php',
          id:'1', //show only the group ID is 1,this id are flexible,not necessary is 1
          fields: ['DeviceID','VehicleNo']
      } 
  });
  </code></pre>
  
  <h2>this is the code on the toolbar</h2>
  
  <pre><code>xtype: 'combobox',
  labelWidth: 50,
  labelAlign: 'right',
  fieldLabel: 'Vehicle',
  name: 'state1',
  width :180,
  store: store1,
  valueField: 'DeviceID',
  displayField: 'VehicleNo',
  typeAhead: true,
  queryMode: 'local',
  emptyText: 'Select a Vehicle...'
  </code></pre>
  
  <h2>combobox.php</h2>
  
  <pre><code>&lt;?php
  mysql_connect("localhost", "root", "") or die("Could not connect");
  mysql_select_db("db_gps") or die("Could not select database");
  $parent_id = $_GET['id'];
  $query = "SELECT DeviceID as id, VehicleNo as text FROM Tbl_device WHERE GroupID='".$parent_id."' ORDER BY text ASC";
  $rs = mysql_query($query);
  $arr = array();
  while($obj = mysql_fetch_object($rs)) {
   $arr[] = $obj;
  }
  echo json_encode($arr);
  ?&gt;
  </code></pre>
  
  <h2>Mysql Database</h2>
  
  <pre><code>delimiter $$
  
      CREATE TABLE `tbl_device` (
        `MainID` int(11) NOT NULL AUTO_INCREMENT,
        `DeviceID` varchar(11) NOT NULL,
        `VehicleNo` varchar(45) NOT NULL,
        `GroupID` varchar(45) NOT NULL,
        `AutoPic` bit(1) NOT NULL DEFAULT b'0',
        PRIMARY KEY (`MainID`)
      ) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=latin1$$
  </code></pre>
  
  <h2>Question</h2>
  
  <p>1)i can't display the combobox data ?is that any problem with my code? please help,thanks.on my code i m trying to pass the parameter of id, u can see from my code i m passing id:1 to combobox.php, this passing value are flexible, not necessary is 1 only
  2)is this code data model are correct?with DeviceID and VehicleNo fields</p>