Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //onCellClick to open Editor or Delete Record with Ajax Function
- var target, column, record;
- var onCellClick = function(oArgs) {
- target = oArgs.target, // cell element
- column = this.getColumn(target), // column reference
- record = this.getRecord(target); // record object
- var myPageID = record.getData("PageID"); //alert(myPageID);
- var myPageURI = record.getData("PageURI"); //alert(myPageID);
- switch (column.action) {
- case 'delete':
- if (confirm('Are you sure you want to delete this record?')) {
- YAHOO.util.Connect.asyncRequest(
- 'GET',
- 'db_pages.php?action=delete&PageID=' + myPageID,
- {
- success: function (o) {
- if (o.statusText == 'OK') {
- this.deleteRow(target);
- } else {
- alert(o.statusText );
- }
- },
- failure: function (o) {
- alert(o.statusText);
- },
- scope:this
- }
- );
- }
- break;
Add Comment
Please, Sign In to add comment