Guest User

Untitled

a guest
Jun 22nd, 2018
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.94 KB | None | 0 0
  1. //onCellClick to open Editor or Delete Record with Ajax Function
  2. var target, column, record;
  3. var onCellClick = function(oArgs) {
  4. target = oArgs.target, // cell element
  5. column = this.getColumn(target), // column reference
  6. record = this.getRecord(target); // record object
  7. var myPageID = record.getData("PageID"); //alert(myPageID);
  8. var myPageURI = record.getData("PageURI"); //alert(myPageID);
  9.  
  10. switch (column.action) {
  11. case 'delete':
  12. if (confirm('Are you sure you want to delete this record?')) {
  13.  
  14. YAHOO.util.Connect.asyncRequest(
  15. 'GET',
  16. 'db_pages.php?action=delete&PageID=' + myPageID,
  17. {
  18. success: function (o) {
  19. if (o.statusText == 'OK') {
  20. this.deleteRow(target);
  21. } else {
  22. alert(o.statusText );
  23. }
  24. },
  25. failure: function (o) {
  26. alert(o.statusText);
  27. },
  28. scope:this
  29. }
  30. );
  31. }
  32. break;
Add Comment
Please, Sign In to add comment