2013-03-08 41 views
0

我創建jQuery UI的對話框是這樣的:想顯示繼續,如果我OK按鈕點擊從jQuery UI的對話框

$("<div></div>").dialog({ 
      autoOpen: true, //for info, true is default 
      modal: true, 
      title: ':' + Id, 
      width: '340', 
      minHeight: '200', 

      open: function() { 

      }, 
      close: function() { 
       $(this).dialog('destroy'); 
      } 
     }); 
在此

,我想設置OK按鈕,如果我按OK按鈕,它會經過下面的AJAX方法:

$.ajax({ 
      url: "Home.aspx/DeleteProject", 
      type: "POST", 
      dataType: 'json', 
      contentType: 'application/json; charset=utf-8', 
      data: "{'projectSoid': '" + Id + "'}", 
      async: false, 
      success: function (data) { 

       if (data.d == "") 
       { 
        ProjectCarousel(); 
       } 
      }, 
      error: function (xhr) { 
      } 
     }); 
+0

是「確定」按鈕關閉對話框上_only_按鈕,或者是有一個「取消」按鈕呢? – Alnitak 2013-03-08 15:09:19

回答

0
$("<div></div>").dialog({ 
      autoOpen: true, //for info, true is default 
      modal: true, 
      title: ':' + Id, 
      width: '340', 
      minHeight: '200', 
      buttons: { 
      "Ok":function() { 
       callAjaxHere(); 
      } 
      },  
      open: function() { 

      }, 
      close: function() { 
       $(this).dialog('destroy'); 
      } 
相關問題