extjsは間接クラス定義システムを使用しています。ここに例がありますスクリプト# - extjs関数をラップするための提案が必要です。
Ext.define('User', {
extend: 'Ext.data.Model',
fields: [
{name: 'name', type: 'string'},
{name: 'age', type: 'int'},
{name: 'phone', type: 'string'},
{name: 'alive', type: 'boolean', defaultValue: true}
],
changeName: function() {
var oldName = this.get('name'),
newName = oldName + " The Barbarian";
this.set('name', newName);
}
});
私はこれを#で包む方法を工夫しています。ここでは、私はラップするためにtryiung正確なものです
Ext.define('jslate.data.Proxy', {
extend: 'Ext.data.proxy.Client',
constructor: function (config) {
this.callParent([config]);
//ensures that the reader has been instantiated properly
this.setReader(this.reader);
this.dataManager = config.dataManager;
},
read: function (operation, callback, scope) {
var me = this;
me.dataManager.read(operation, callback, scope);
},
clear: Ext.emptyFn
});
私はこれを行う方法を参照してください - どのような提案ですか?たとえば、関数名と定義の任意のサイズの配列が必要です。各関数には任意の数の引数があります。私はそこに「これ」を得ますか?
優れた回答 - 私たちはあなたの2番目の方法(それは私がやろうとしていたものと一致しています)をフォローアップするために電子メールで少しチャットできますか?[email protected] – pm100