-
|
I have a grid view with a column that when clicked opens another page as an iFrame in a Fancybox. The link is
When the Fancybox is closed after completing the task, I would like the Gridview to rebind with the new values that were changed through the Fancybox page. I have tried this on the originating page
also tried parent.location.reload(true); on the originating page but cannot even get the page to refresh let alone the gridview to rebind. Any help would be much appreciated as I'm going in circles trying to resolve this. |
Beta Was this translation helpful? Give feedback.
Replies: 6 comments 1 reply
-
|
Hi, First, you need to specify which version of Fancybox you are using, because For v4, simply use |
Beta Was this translation helpful? Give feedback.
-
|
Ah OK I changed the script links to V4 but couldn't find a specific answers to my question so was working with what I had. I presume I could go back to V3 if this works, but as its now unsupported would make sense to get it working with V4. |
Beta Was this translation helpful? Give feedback.
-
|
So, did you try something like this? Fancybox.bind("[data-fancybox]", {
on: {
closing: () => {
// Refresh my data
// ...
},
},
}); |
Beta Was this translation helpful? Give feedback.
-
|
Ah OK thats now triggering a response. What I forgot to mention is that the link above is in an iframe thats loaded in to a user interface so the fancy box iframe is in effect called from a iframe. Can I refresh just the originating iframe on close. As V4 is very new I'm struggling to find any examples for what I want to achieve. |
Beta Was this translation helpful? Give feedback.
-
|
I'm sorry, but I don't understand what exactly makes you to struggle. How to determine when Fancybox is closing - Fancybox.bind("[data-fancybox]", {
on: {
closing: () => {
// your code
},
},
});How to refresh parent page - window.parent.location.reload();Combine that: Fancybox.bind("[data-fancybox]", {
on: {
closing: () => {
window.parent.location.reload();
},
},
});So, please, ask a more specific question or show your page/demo. |
Beta Was this translation helpful? Give feedback.
-
|
Sorry thanks for the heads up, I have fixed the issue now, the Fancybox.bind allowed me to refresh the iframe in question using window.parent.document.getElementById("iframepage").contentWindow.location.reload(); |
Beta Was this translation helpful? Give feedback.
I'm sorry, but I don't understand what exactly makes you to struggle.
How to determine when Fancybox is closing -
How to refresh parent page -
Combine that:
So, please, ask a more specific question or show your page/demo.