2017-06-15 31 views
0

我創建了一個對話框,它調用用戶Control來創建網格並分別填充它。但是這個用戶控件是早期使用的,所以當我顯示對話框時,它向我展示了同一個網格。所以,爲了再次調用用戶控件,我希望它的加載事件再次被激發。是否有可能做到這一點。下面是我的代碼:是否可以從JQuery OnClient Click事件中調用網頁LOAD事件?

HTML

<%@ Register TagPrefix="uc" TagName="ReviewGroupGrid" Src="UserControls/ReviewGroupGrid.ascx" %> 
<%@ Register TagPrefix="uc" TagName="ReviewGroupGrids" Src="UserControls/ReviewGroupGrid.ascx" %> 
<%@ Register Assembly="OCM.Phoenix.WebToolsFramework.Server.Modules.DataSteward.WebExtensions" Namespace="OCM.Phoenix.WebToolsFramework.Server.Modules.DataSteward.WebExtensions" TagPrefix="cc1" %> 
<asp:Content ID="BodyContent" runat="server" ContentPlaceHolderID="DataStewardContent"> 

<cc1:Button ID="btnMerge" runat="server" Text="Merge &amp; Edit" OnClick="btnMerge_Click" 
          OnClientClick="javascript:return reviewGroupForm.getSelectedRowsForMerge()" /> 
<div class="modal-dialog" id="updateClaimConfirmPopUp" style="display: none"> 
    <div class="modal-content"> 
     <div class="modal-header" id="popUpHeader"> 
      <button type="button" class="close closeClaimPopUp"> 
       <span>&times;</span></button> 
     </div> 
     <div class="modal-body" id="confirmData"> 
      <div id="random"></div> 
      <div class="dataTable_wrapper"> 
       <div class="table-responsive"> 
        <uc:ReviewGroupGrids ID="reviewGroupCtrls" runat="Server" /> 
       </div> 
      </div> 
     </div> 
     <div class="modal-footer"> 
      <asp:LinkButton ID="claimMerge" CssClass="buttonClassClaim btn btn-primary" runat="server" Text="Accept" OnClick="btnMerge_Click"/> 
      <button type="button" id="btnClosePopUp" class="buttonClassClaim btn btn-primary closeClaimPopUp"> 
       Discard</button> 
     </div> 
    </div> 
</div> 
</asp:Content> 

jQuery的

getSelectedRowsForMerge: function() { 
           var entityType = $("input[id*='hdnEntityType']").val(); 
           if (entityType === "19") { 
           $('#popUpHeader').find('h4').remove(); 
           $('#random').find('h4').remove(); 
           $('#popUpHeader').append(' <h4 class="modal-title" > ' + 'Need Your' + ' Attention!</h4>'); 
           $('#random').append('<h4><b> ' + 'The Claims that you are merging are associated with different patients, merging the claims will result in explicit merging of the associated Patients as well, Please review the patient(s) details shown below before merging the claim' + '</b></h4>'); 
           //$('#confirmData').append('<div class="table-responsive"').append(' <uc:ReviewGroupGrid ID="reviewGroupCtrl" runat="Server" />').append('</div>'); 
           $("#updateClaimConfirmPopUp").dialog({ 
            autoOpen: true, 
            width: 1600, 
            resizable: false, 
            draggable: true, 
            modal: true, 
            show: { effect: 'blind' } 
           }); 
          } 
}, 

當越來越創建我的對話框,它是在創建用戶控制,但這個用戶控制已填充。我想調用它的加載事件,以便用戶控制再次處理。打開對話框時,我可以通過點擊事件來做到這一點嗎?

回答

0

你想讓btnMerge在每次顯示時刷新div。如果是這樣,那麼你需要通過getSelectedRowsForMerge中的ajax調用從服務器獲取數據,該數據可以更新ReviewGroupGrids控件中顯示的數據。在這個承諾的成功處理程序中,設置彈出窗口而不是立即顯示。這將刷新一切在div,並且不需要任何服務器端的負載事件

摘錄如下,請加入真正的代碼

getSelectedRowsForMerge: function() { 
// various cleanups as present 
$.ajax(...) 
    .success(function() { 
      //show the div 
      $("#updateClaimConfirmPopUp").dialog({ .... }); 
      })