에 추가하고 아무것도 추가하거나 제거 또는 Rally.data.custom.Store
저장소와 제대로 업데이트하기 이유 의미가 나의 저장소입니다. 메모리 프록시의 작성 W 파기 메소드를 대체해야합니다.
현재 메모리 PROXY 기능
이러한 메모리 프록시에 대한 기록을 생성하고 파괴하는 데 사용되는 함수입니다. 당신이 볼 수 있듯이, 그들은 ... 만들거나 기록을 파괴 해달라고
updateOperation: function(operation, callback, scope) {
var i = 0,
recs = operation.getRecords(),
len = recs.length;
for (i; i < len; i++) {
recs[i].commit();
}
operation.setCompleted();
operation.setSuccessful();
Ext.callback(callback, scope || this, [operation]);
},
create: function() {
this.updateOperation.apply(this, arguments);
},
destroy: function() {
this.updateOperation.apply(this, arguments);
},
올바른 메모리 PROXY 설정
다음
실제로 사용자 정의 레코드를 추가하고 제거하는 사용자 정의 저장소를 인스턴스화하는 방법입니다 상점
me.customStore = Ext.create('Rally.data.custom.Store', {
data: //customData
model: //modelType
autoSync:true,
proxy: {
type:'memory',
create: function(operation) {
var me = this;
operation.getRecords().forEach(function(record){
console.log('adding record', record);
me.data.push(record);
});
this.updateOperation.apply(this, arguments);
},
destroy: function(operation) {
var me = this;
operation.getRecords().forEach(function(record){
console.log(record);
for(var i = 0;i<me.data.length;++i){
if(/*me.data[i] == record*/){
me.data.splice(i, 1);
return;
}
}
});
this.updateOperation.apply(this, arguments);
}
},
listeners://listener stuff here
});