Kindly help in one issue:-
Form Submit always going in Failure function (callback) even though success is returned in the JSON response, below is my code:-
headerDetailForm.submit({
clientValidation: false, //done above
url : isNewLead ? '/leadmanagementservice/addLead' : '/leadmanagementservice/updateLead',
method: 'POST',
params: {
requestOrganizationId: headerDetailForm.findField('operUnitId').getValue(),
OU: User.ou,
requestOrganizationId : User.ou ,
organizationId :User.swbOu,
responsibilityId : User.swbResponsibilityId,
id : isNewLead ? '' : headerDetailForm.findField('id').getValue()
},
success: function(form, action) {
//this === view
var data, toolbar, field;
mask.hide().destroy();
-------------------------
}
Json Response:-
{"leadmanagementservicedata": {
"responseStatus": {
"returnCode": 0,
"returnMessage": "Lead Updated"
},
"success": true,
"total": 1,
"lead": {
"id": 190,
"leadNumber": 62,
"ownerId": 0,
"company": "Frank's Company NE"
}
}}
Here is the code of the form:-
Ext.define('LWB.view.form.LeadDetail', {
extend: 'Ext.form.Panel',
alias: 'widget.leadheaderform',
requires: ['LWB.model.LeadHeader'],
title: 'Lead Header',
bodyPadding: 0,
autoScroll: true,
bodyCls: 'swb-form-panel',
layout: 'absolute',
reader: new Ext.data.JsonReader({
root: 'leadmanagementservicedata.lead',
successProperty: 'leadmanagementservicedata.success',
model: 'LWB.model.LeadHeader',
}),
------------
------------
Every time after the form submit, the control goes into failure block, even though the json response has success as true and it is a valid json.
Form Submit always going in Failure function (callback)
Aucun commentaire:
Enregistrer un commentaire