Copy code code as follows:
/**
* Ajax Way Delete Information--Background data
*
* ACTION
* ID PRIMARY key value
* obj Delete line <a>
/
Function Removerow (action,id,obj) {
If confirm (' OK to delete? ') {
Ext.Ajax.request ({
Url:encodeuri) ("Alone.portal?"). F=${namespace}&.pmn=view&action= "+action",
params: {
Id:id
},
Success:function (respon SE) {
delrow (obj);
Alert (delete succeeded!) ");
},
Failure:function (response) {
Alert ("Connection exception or network interruption!") ");
}
});
}
//delete rows
function Delrow (oelement) {
//judging the current element of the response event
//var myevent = evt?evt: (window.event ? window.event:null);
//var oelement = myevent.srcelement? myEvent.srcElement:myEvent.target;
while (oelement.tagname!= "TR") {//always looking for an object to get to TR
Oelement=oelement.parentnode;
}
Var Otbody=oelement.parentnode;//Get Table Object
Otbody.removechild (oelement);
}