Advertisement
Guest User

Untitled

a guest
Nov 27th, 2014
141
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.41 KB | None | 0 0
  1. $("#GlobalDialogBox").dialog({
  2. modal: true,
  3. buttons: {
  4. "Yes": function () {
  5. callbackFunctionTrue();
  6. $(this).dialog('close');
  7. },
  8. "No": function () {
  9. callbackFunctionFalse();
  10. $(this).dialog('close');
  11. }
  12. }
  13. });
  14.  
  15. alert("This should fire after answering the dialog box."); //but this fires as soon as the dialog pops up.. :(
  16.  
  17. $("#GlobalDialogBox").on( "dialogclose", function( event, ui ) {
  18. alert("something");
  19. });
  20.  
  21. $("#GlobalDialogBox").dialog({
  22. modal: true,
  23. buttons: {
  24. "Yes": function () {
  25. callbackFunctionTrue();
  26. $(this).dialog('close');
  27. },
  28. "No": function () {
  29. callbackFunctionFalse();
  30. $(this).dialog('close');
  31. }
  32. },
  33. close: function(event, ui){
  34. alert("something");
  35. }
  36. });
  37.  
  38. function dialog_confirm(){
  39. $( "#dialog-confirm" ).dialog({
  40. //autoOpen: false,
  41. resizable: false,
  42. height:140,
  43. modal: true,
  44. buttons: {
  45. "Delete all items": function() {
  46. $( this ).dialog( "close" );
  47. dialog_confirm_callback(true);
  48. },
  49. Cancel: function() {
  50. $( this ).dialog( "close" );
  51. dialog_confirm_callback(false);
  52. }
  53. }
  54. });
  55. }
  56. function dialog_confirm_callback(value) {
  57. if (value) {
  58. alert("Confirmed");
  59. } else {
  60. alert("Rejected");
  61. }
  62. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement