0
Ext.data.Store를 재정의하여 모든 상점에 맞춤 예외 처리 기능을 적용하고 싶습니다.Ext.data.Store를 무시하고, 생성자를 호출하십시오.
Ext.define("Override.data.Store", {
override:'Ext.data.Store',
constructor:function() {
this.callParent(arguments);
if(this.getProxy() && this.getProxy().getReader())
this.getProxy().getReader().on('exception',function(reader,response,error) {
if(!isLoggedIn(response)) window.location.reload();
else Ext.Msg.alert("Error reading data.",error);
});
}
});
내가 대신 this.callParent(arguments);
의 내가 스토어의 슈퍼 클래스의 생성자를 원하지 않기 때문에, 다른 요술 기능을 사용 할 것이라고 생각하지만, 생성자 :
그래서 나는 코드 원래 스토어의 누구든지 재정의 된 클래스에서 함수를 가져 오는 방법을 알고 있습니까?
두 번째로 작동 시키려면 어느 디렉토리에 해당 대체 정의를 넣어야합니까? 원래 스토어는 이고, 내 파일을 app/override/data/Store.js
에 넣었지만 작동하지 않습니다.