///
var store12=new Ext.data.JsonStore({
 
    //results 表示结果数
    //rows 表示从后台传过来的JSON数据
    data:{ "results": 2, "rows":[
        {"id":1, "city": "suzhou", "areacode": "0512", "perincome": "2500" },
        {"id":2, "city": "nanjing", "areacode": "025", "perincome": "2200" }]},

       //自动加载(不能用store.load())
    autoLoad:true,
    totalProperty:"results",

    root:"rows",

    fields:[{name:'city',mapping:'city'},

    {name:'areacode',type:'int'},

    {name:'perincome',mapping:'perincome',type:'int'},

    {name:'id',mapping:'id',type:'int'}

    ]

  });

  var bottomSearch12 = new Ext.form.ComboBox({
      fieldLabel: 'Country Code',
      name: 'country_code',
      forceSelection: true,
      listWidth: 200,
      store: store12,
      valueField: 'areacode',
      displayField: 'city',
      typeAhead: true,
      mode: 'local',
      triggerAction: 'all',
      selectOnFocus: true, //用户不能自己输入,只能选择列表中有的记录
      allowBlank: false,
      listeners: {
          select: function() {
              alert(this.value);
          }
      }
 
  })

相关文章:

  • 2021-10-22
  • 2022-12-23
  • 2022-12-23
  • 2021-04-06
  • 2021-06-27
  • 2022-01-17
  • 2021-09-14
猜你喜欢
  • 2021-09-12
  • 2022-12-23
  • 2021-05-30
  • 2022-01-04
  • 2021-07-03
  • 2021-12-06
相关资源
相似解决方案