Ext.data.JsonStore 数据集使用

  ///
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);
          }
      }
 
  })

作者: 王德田 发表于 2011-04-02 13:39 原文链接

评论: 0 查看评论 发表评论


最新新闻:
· Spring.NET Visual Studio 2010 Extension 1.0.0(2011-04-08 08:50)
· 微软前工程师用谷歌地图建旅游搜索引擎(2011-04-08 08:49)
· 熊晓鸽:投资奇虎360回报率约50倍(2011-04-08 08:47)
· 永中科技创始人:永中office败于盗版 没输微软(2011-04-08 08:46)
· 惠普诉前高管非法窃取机密情报并提供给对手(2011-04-08 08:45)

编辑推荐:C#开发Android应用的必备——Mono for Android V1.0 发布

网站导航:博客园首页  我的园子  新闻  闪存  小组  博问  知识库

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值