How to send POST data to server in Sencha Touch without using AJAX
I am using Sencha Touch, I need to send some data to the server with a simple HTTP POST (NO AJAX)
I am currently using
Ext.data.JsonP.request
Ext.Ajax.request
for my understanding both work with AJAX.
I would like to know how to disable the AJAX functionality and let me send some parasites over HTTP only without using xhr and ajax.
+3
source to share
1 answer
You can create a form bar and then call a method submit
with a URL for the form to be submitted:
// define your form
var form = Ext.create('Ext.form.Panel', {
...
// your form fields, etc
});
// later, in some handler for a button click, etc
form.submit({
url: 'url/to/submit.php',
method: 'POST',
success: function() {
// handle successful form submit
},
failure: funciton() { ... }
});
+4
source to share