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

你可能感兴趣的:(group)