Need your advice. When I'm using direct api action 'load' inside an extended form component, the form is loosing scope when loading, and I get the error message:
Code:
this.processResponse is not a function
and therefor formdata won’t be uploaded. Here is the form
Code:
AD.app.Update = Ext.extend(Ext.form.FormPanel, {
initComponent: function() {
Ext.apply(this, {
layout: 'anchor'
,autoWidth: true
,autoHeight: true
,monitorValid: true
,resetAfterSubmit: true
,paramsAsHash: true
,items: [{
xtype: 'fieldset'
,items: [{
xtype: 'textfield'
,fieldLabel: 'element'
,name: 'id'
}]
}]
,buttonAlign:'center'
,buttons: [{
text: 'Load'
,scope: this
,handler: function() {
this.getForm().load({
waitMsg: 'Requesting...'
,scope: this
,params:{id: 123465}
,success: function() {
this.ownerCt.destroy();
}
,failure: function(form, action) {
Ext.Msg.alert('Load Failed!', 'Please come back later.');
}
});
}
},{
text: 'Cancel'
,scope: this
,handler: function(){
this.ownerCt.destroy();
}
}]
});
AD.app.Update.superclass.initComponent.call(this);
this.form.api = {
load: assets.load
,submit: assets.update
};
}
});
Ext.reg('form-update', AD.app.Update);
IMO, it seems like the form is loosing scope. Or may be it something else? - scoping in extjs sounds like voodoo to me for now.