The AJAX request and form's Submit method set the request in the same way as it did, using method: ' POST ' settings
Form submission
Winform.getform (). Submit ({
waittitle: ' Hint ',//title
waitmsg: ' Submitting data Please later ... ',//prompt info
url: '. /.. /.. /dayreportcontroller/add.do ', method
: ' POST ',
params: {//Here you can add additional parameters
Extraparems: ' Extraparems '
},
success:function (form, action) {
/
* * The second method gets the return value of
var success = action.result.success;
Alert (success);
* *
var resptext = Ext.util.JSON.decode (action.response.responseText)
if (resptext.success = = True) {
Ext.Msg.alert (' message ', ' save success. ');
EXT.GETCMP (' win '). Close ()///Add Success closes the window
ext.getcmp (' Menugrid '). GetStore (). reload ();
{
Ext.Msg.alert (' message ', resptext.msg);
}
},
failure:function (form, action) {
Ext.Msg.alert ("message", "Operation failed!");
}
);
Ext.Ajax.request ({method
: ' POST ',
URL: '.. /.. /.. /dayreportcontroller/deletemenu.do ',
params: {
' ID ': ID//To delete the ID of the record
},
success:function (response, Config) {
*
//background: Out.print (1);
var result = Response.responsetext;
if (parseint (result) = = 1) {
ext.getcmp (' Menugrid '). GetStore (). reload ();
Ext.Msg.alert ("Hint", ' delete succeeded! ');
} else {
Ext.Msg.alert (' Hint ', ' delete failed! ');
}
*
//Backstage: Out.print ({success:true});
var json = Ext.util.JSON.decode (response.responsetext);
if (json.success = = True) {
ext.getcmp (' Menugrid '). GetStore (). reload ();
Ext.Msg.alert ("Hint", ' delete succeeded! ');
} else {
Ext.Msg.alert (' Hint ', ' delete failed! ')
}
,
failure:function () {
Ext.Msg.alert (' Hint ', ' delete failed! ');
}
});
Store Setup request method using Actionmethods: {
READ: ' POST '
}
var store = ext.create (' Ext.data.Store ', {
//autoload:true,
pageSize:main.gridPageSize,
fields: [' id ', ' Text ', ' description ', ' url ', ' leaf '],
proxy:new Ext.data.HttpProxy ({
type: ' Ajax ',
URL: ' ... /.. /.. /dayreportcontroller/test.do ',
actionmethods: {
read: ' POST '//Store the method of setting the request is different from the AJAX request
},
Reader : New Ext.data.JsonReader ({
type: ' JSON ',
rootproperty: ' Data ',//(not configured to receive data), key
returned Totalproperty: ' Totalrecord '//record number (cannot be paging without configuration), return key is Totalrecord})})
;