Ajax way to delete a table row of data sample code _ajax related

Source: Internet
Author: User
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);
}
Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.