I have a question.
I need to send a json format to my backend service. It requires something i haven’t managed to create. What i am sending with a form is this:
{
"jobs": {
"name": "dsvs",
"jobType": "CUSTOM",
"description": "sdvsdv",
"tasks": "14,15,16"
}
}
but what i need to send is
{
"jobs": {
"name": "dsvs",
"jobType": "CUSTOM",
"description": "sdvsdv",
"tasks": [14,15,16]
}
}
how can i do this?
This is my form handler:
handler: function () {
var form = this.up('form').getForm();
var formData = Ext.encode(form.getValues());
Ext.Ajax.request({
url: ND.url + 'dna/rjs/secure/service/rest/jobs.json',
method: 'POST',
waitTitle: 'Connecting',
waitMsg: 'Sending data...',
jsonData: {
jobs: form.getValues()
}
});
})
I hope anyone has an idea!
You can’t by “honest” ways.
You can, however, hack it into that one.
You don’t use your
formDatain your example, despite having it, BTW.That would result in:
If that is still not suitable, than you can further hack it by calling
parseInton each task value.EDIT:
Added clarification.