Refresh grid from iframe

QuestionsRefresh grid from iframe
Stephen Hartigan asked 10 years ago

Hi,

I have an iframe shown when a subgrid is revealed, Is there a simple way to refresh the subgrid when a form in the iframe is submitted?

Many Thanks,

Stephen

5 Answers
Abu Ghufran answered 10 years ago

Hello,

To reload parent grid from iframe …

$("#list1", window.parent.document).trigger("reloadGrid", [{current:true}]);
(where list1 is parent grid id)

Stephen Hartigan answered 10 years ago

Hi Abu,

I've tried the code below from the iframe ("sub1 is the name of my subgrid), however the subgrid is not refreshing, any ideas?

$("#sub1", window.parent.document).trigger("reloadGrid", [{current:true}]);

Thanks Stephen

Abu Ghufran answered 10 years ago

Try this:

1) Define a function in parent grid file.

<script>
function reloadList() {
$("#sub1").trigger("reloadGrid");
};
</script>

2) And then from iframe file, call this reloadList(), e.g.

<a onclick='window.top.reloadList()'>Reload</a>

I also verified it, let me know if you need source.

Stephen Hartigan answered 10 years ago

Hi Abu,

Thanks for your help with this.

I have tested the script, I cannot get the subgrid "sub1" to refresh, if I change the name to "list1" the master grid does refresh. Is it possible to only refresh the subgrid?

Stephen

Abu Ghufran answered 10 years ago

As you are calling this refresh code from subgrid (sub1), reload() function should work.
window.location.reload();

If this does not work, please email me the screenshots of your work and desired behavior you need.
Looks like i am not understanding it correctly.
You can email me at [email protected]

Your Answer

1 + 14 =

Login with your Social Id:

OR, enter

Attach code here and paste link in question.
Attach screenshot here and paste link in question.



How useful was this discussion?

Click on a star to rate it!

Average rating 0 / 5. Vote count: 0

No votes so far! Be the first to rate it.

We are sorry that this post was not useful for you!

Let us improve this post!

Tell us how we can improve this post?