Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Jquery ui dialog close event?

I want to refresh page when close the dialog? Is this possible? How can I do this? There are links that opens the their own dialog. But When I clicked first time any link, dialog cache it's id, And then I clicked others, link id always same (first clicked id).

Should I refresh the page when close the dialog or Is there another way to fix this problem.

I use codes in below for opening dialog:

@foreach (var item in Model)
{
   <tr>
       <td>@Html.ActionLink(linkText: item.musteri_adi,
           actionName: "MusteriDuzenle",
           controllerName: "Musteri",
           routeValues: new { sno = item.sno },
           htmlAttributes: new { @class = "open_dialog", data_dialog_title = item.musteri_adi })
       </td>
       <td>@Html.DisplayFor(x => item.fatura_adresi)
       </td>
   </tr>
}

Thanks. And sorry my poor english :)

like image 414
AliRıza Adıyahşi Avatar asked Mar 12 '26 03:03

AliRıza Adıyahşi


1 Answers

You can use beforeClose event to call a function to refresh your page.

$( "#myDialog" ).dialog({
   beforeClose: function(event, ui) {
      window.location.reload(); 
      // or you can use window.location = 'mypage.html';
}
});
like image 166
varu Avatar answered Mar 13 '26 17:03

varu



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!