The same point: all belong to the Ajax submission Method!
Different points: Ext.Ajax.request is an example of Ext.data.connection
Form1.getform (). Submit is a way to implement Basicform
The difference in use:
1.form1.getform (). Submit is often used when a form is submitted, that is, to submit page data, such as adding and modifying data pages
2.ext.ajax.request is commonly used when submitted according to the parameters, such as delete, we will select the page ID to traverse, encapsulated in an array, as a parameter to do Ajax submission
Example:
The first is the Form1.getform (). Submit Example:
Function formsubmit () { if (Form1.getform (). IsValid ()) { form1.getform (). Submit ({ waittitle : ' hint ',//title waitMsg : ' submitting data Please later ... ',//prompt Information url : ' Eidtbooktype.action ', method : ' post ', params : ' BookType ', success : function (form, action) { var flag=action.result.msg; window.returnvalue= ' SUCC '; ext.msg.alert (' Hint ', flag,function () { window.close (); }); }, failure : function (form,action) { var flag=acTion.result.msg; ext.msg.alert (' operation ', flag); } }); }}
Next is an example of a Ext.Ajax.request:
Ext.Ajax.request ({ url : ' Deletebooktypes.action ', method : ' post ', params : {delids:deleteids.tostring ()}, success : function (form,action) { //alert (response.responsetext); //returns the JSON value of the string var resptext = ext.util.json.decode (form.responsetext); //bar string into JSON format var msg=respText.msg; ext.messagebox.alert (' Hint ', msg,function () { booktypestore.reload (); }); }, failure : function (response,options) { var resptext = ext.util.json.decode ( Response.responsetext); //bar string into JSON format var msg= Resptext.msg; ext.messagebox.alert (' Hint ', msg,function () { booktypestore.reload (); }); } });
The difference between using the Yes:
The most obvious is the success and failure time function parameters!
The Ext.Ajax.request function (response,options), option is very useful, Use Response.responsetext to get the return parameter, note that the response parameter of this place can be changed to action
Form1.getform (). Submit function (form, action), action is useful, use action.result.msg to get the return value
There is one of the most obvious difference is Ext.Ajax.request can not use waitmsg, really ext a failure!!!
There is also one of the most noteworthy places:
Form1.getform (). The value returned by the submit must contain success:true or failue:true
This is the final judgment of the success of the key!!!
And Ext.Ajax.request do not need this parameter, as long as the exception is not thrown, it must be success success!!!
ExtJS in Ext.Ajax.request and Form1.getform (). The basic difference between submit