Is it possible to submit extjs form via HTTP PUT method? I want to update record on Rails 3, which accept PUT method to update.
Here is my code:
formData.submit({ url: "/layers/" + param.layer_id + "/rules_property_thresholds/" + param.id ,
method:'PUT',
params: param,
waitTitle: "Please wait...",
waitMsg: 'Updating rule property threshold...',
.........
});
I place method PUT but the request still doing POST when I check on Firebug(Net). Thanks
Only HTML5 is supporting PUT via the form directly. Forms up until now only support GET & POST.
For now you need to use ajax to submit the form via PUT:
Ext.Ajax.request({
url: 'your url', // you can fix a parameter like this : url?action=anAction1
method: 'PUT',
params: {
myField1: myField1.getValue()
// all your params....
}
success: function (result, request){
alert('Succesfully added ' + result.responseText);
},
failure: function (result, request){
alert('Error in server' + result.responseText);
}
);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With