store增加load事件,执行each遍历找出重复的记录进行删除
var store = Ext.create('Ext.data.Store', {
listeners: { load: function () {
var k, repeat = [], state = {};
this.each(function (r) {
k = r.get('需要去重复的键名称');
if (state[k]) repeat.push(r);
else state[k] = true;
});
this.remove(repeat);
}
}
});