PDA

View Full Version : DirectLoad action problem



Andrulik
10 Feb 2010, 5:32 AM
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:

this.processResponse is not a function
and therefor formdata won’t be uploaded. Here is the form


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.

dearsina
13 Feb 2010, 5:21 AM
are you sure the form data isn't submitted? check with firebug. usually when i get errors like yours it's because i haven't formatted the *incoming* data source correctly.

dearsina
13 Feb 2010, 5:22 AM
also, see this thread, seems this guy had the same problem:

http://www.extjs.com/forum/showthread.php?t=86826&highlight=directload