extJSにおけるscopeの意味
scopeなし
launch: function () { Ext.Ajax.request({ success: function(response){ // エラーになる store = this.getMyJsonStoreStore(); } }); }
scopeにthisを指定
launch: function () { Ext.Ajax.request({ success: function(response){ // エラーにならない store = this.getMyJsonStoreStore(); }, scope: this }); }
scopeなしの場合だと、thisがExt.Ajaxを指すため、getMyJsonStoreStore()なんて無いよとエラーになる。
一方、scopeにthisを指定すると、success内のthisがlaunch内のthisを指すことになるため、getMyJsonStoreStore()が正常に実行される。