Copy codeThe Code is as follows:
/**
* Ajax-based Information deletion-Background Data
*
* Action
* Id Primary Key Value
* Obj <a>
*/
Function removeRow (action, id, obj ){
If (confirm ('Are you sure you want to delete it? ')){
Ext. Ajax. request ({
Url: encodeURI ("alone. portal ?. F =$ {namespace} &. pmn = view & action = "+ action ),
Params :{
Id: id
},
Success: function (response ){
Delrow (obj );
Alert ("deleted successfully! ");
},
Failure: function (response ){
Alert ("connection exception or network interruption! ");
}
});
}
}
// Delete a row
Function delrow (oElement ){
// Determine the current element of the response event
// Var myEvent = evt? Evt :( window. event? Window. event: null );
// Var oElement = myEvent. srcElement? MyEvent. srcElement: myEvent.tar get;
While (oElement. tagName! = "TR") {// always find the object that is obtained as TR
OElement = oElement. parentNode;
}
Var oTBody = oElement. parentNode; // retrieves a table object.
OTBody. removeChild (oElement );
}