ExtJS

extjsでビューからコントローラー名を取得する方法

MyAppName.app.getController('コントローラー名'); Why does this.getApplication().getController('MainController').testFunction(); fail

Ext.apply と Ext.applyIf の違い

Ext.applyは、対象オブジェクトに対して、全てのプロパティを代入する。 console.log(this.foo); // undefined var ret = Ext.apply(this, { foo: 'bar', hoge: 'piyo' }); console.log(this.foo); // bar Ext.applyIfは同じプロパティが存在する場合、上書…

extJSでオブジェクトとJSONの変換

Ext.encode()、Ext.decode()を使う var o = {test: "test2"}; console.log(o); console.log(Ext.encode(o)); console.log(Ext.decode(Ext.encode(o))); 結果 Object {test: "test2"} {"test":"test2"} Object {test: "test2"}

extJSにおけるscopeの意味

scopeなし launch: function () { Ext.Ajax.request({ success: function(response){ // エラーになる store = this.getMyJsonStoreStore(); } }); } scopeにthisを指定 launch: function () { Ext.Ajax.request({ success: function(response){ // エラーに…