Ext.data.JsonStore 数据集使用
2011-04-02 13:39
513 查看
///
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);
}
}
})
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);
}
}
})
相关文章推荐
- Ext.data.Store 获取Json数据只有一行,而且是最后一行
- EXT核心API详解Ext.data(十二)-GroupingStore/JsonStore/SimpleStore javascript
- Ext.data-GroupingStore/JsonStore/SimpleStore
- Ext.data.Store 获取Json数据只有一行,而且是最后一行
- Extjs学习笔记——Ext.data.JsonStore使用说明
- 如何把Ext.data.store里的数据一次性用JSON传给后台(添加了后台解析部分)
- Ext.data.Store 获取Json数据只有一行,而且是最后一行
- Ext.data.Store 获取Json数据只有一行,而且是最后一行
- Ext.data-GroupingStore/JsonStore/SimpleStore
- Ext.data-GroupingStore/ JsonStore/ SimpleStore
- 关于从不同的URL获取JSON数据时Ext.data.Store反映迟缓问题的解决
- Ext.data.Store/GroupingStore/JsonStore/SimpleStore
- Ext.data.JsonStore的用法
- new Ext.data.JsonStore 加载后没有数据显示提示
- 浅谈:Ext.data.JsonStore
- Ext.data-GroupingStore/JsonStore/SimpleStore
- Ext.data.JsonStore使用HttpProxy加载数据时传递参数的两种方法
- ExtJs中同一个URL构造多个Ext.data.JsonStore
- [转载]Ext.data-GroupingStore/JsonStore/SimpleStore
- ExtJs中同一个URL构造多个Ext.data.JsonStore --转载