1
ext-js 4.0.7을 사용하고 있으며 저장 실패시 모델에서 변경 사항을 롤백하는 방법을 찾으려고합니다.Extjs 저장소 저장 실패시 롤백 모델 변경
내 상점은
Ext.define('TEST.store.TestStore',{
extend: 'Ext.data.Store',
storeId: 'testStore',
model: 'TEST.model.TestModel',
autoLoad: false,
proxy: {
type: 'rest',
url: 'some/api',
reader: 'json'
}
});
...
var me=this,
testStore = me.getStore('TEST.store.TestStore');
me.test = testStore.getAt(0);
//here are I am changing it
me.test.save({
failure: function(record,operation) {
console.log(test);
test.reject();
console.log(test);
}
});
입니다하지만 작동하지 않습니다 거부. 이 모델을 삭제할 다른 방법이 있습니까? 감사합니다.