1
내 콜백 함수를 호출 할 때 this
을 어떻게 유지하나요?ExtJs 4.1 다시 콜백 범위
success: Ext.bind(this.readConfigCallback, this)
init: function() {
console.log(this); // constructor, YES!
this.readConfig();
},
readConfig: function() {
console.log(this); // constructor, YES!
this.httpApi.request({
module : 'monitor',
func : 'getConfig',
success : this.readConfigCallback,
scope : this
});
},
readConfigCallback: function(oResponse) {
console.log(this); // Window, NO!
var oView = this.getView(); // error...
}
감사합니다. 앞으로 사용할 것입니다. – Patrick