读书人

ext groupingStroe 使用注意有关问题

发布时间: 2012-09-01 09:33:02 作者: rapoo

ext groupingStroe 使用注意问题

?

?

// shared reader

var reader = new Ext.data.JsonReader({},[{//ArrayReader

name : 'sensorsName'//名字(和地点一样)

}, {

name : 'typeName'//类型

}, {

name : 'siteName'//地点

}, {

name : 'data'//值

}]);


?

?

var store2 = new Ext.data.GroupingStore({// GroupingStore JsonStore

proxy:new Ext.data.HttpProxy({url : '../map.do?method=getAllInMapSensors1'}),

?

autoLoad : true,

?

reader : reader,

sortInfo : {

field : 'sensorsName',

direction : "ASC"

},// 排序的列

groupField : 'typeName'// 分组的列

});

?

?

注意GroupingStore是分组的store,这里一定要用JsonReader才能正确从后台取出数据显示出来。不能用ArrayReader

读书人网 >Web前端

热点推荐