Reload Editable grid View

Hello,

I have a Editable grid View and want to reload the grid after insert or update a register. Any ideas?

Re: Reload Editable grid View

you can use meta tag html to refresh the page.
like this:
<meta http-equiv=“refresh” content=“600”>

Re: Reload Editable grid View

Is this meta tag going to be reloading the page every 600secs? also, as is a meta tag, can I put it on the afterUpdate event

Is there a way to do it with php?

Re: Reload Editable grid View

You can just reload the page:

sc_redir(your_app.php);

Regards,
Scott.

Re: Reload Editable grid View

This html I posted its an example:
you can try this to see if it’s work.
event onScriptInit, put an echo echo “<meta HTTP-EQUIV=‘Refresh’ CONTENT=‘5’>”;

Re: Reload Editable grid View

I Have the same Problem

<meta http-equiv=“refresh” content=“600”>
Is not a good solution!!! The User Must Wait 600 seconds after Insert or Update.
I think a new macro

sc_reload_detail(“master-detail name”);

is a better solution.

Re: Reload Editable grid View

look the parameter ‘content’ is the time to wait until the refresh.
instead of using 600 you can set another value.

Re: Reload Editable grid View

Ok, but I don’t want to refresh every X seconds, only when I wish to.

Re: Reload Editable grid View

When you update records in a editable grid, the records are not yet saved. Unfortunately there’s no functionality in SC to save all changes in the record at once.

I have a form where I created a custom “refresh” button as workaround.

Re: Reload Editable grid View

Freezer,

I like the idea about a Refresh button, what code did you write on it?

Re: Reload Editable grid View

I use a refresh button to update data in the footer, based on the changed data in the editable grid.

I think you can use sc_redir in the button code. You can also add this code to a php button:

echo "<script>location='http://url.to.your.form'</script>";

Mind that this button does not save any unsaved data!

Re: Reload Editable grid View

Can it be done if the edit grid is a detail in a master?
How can I get the url of the detail, but inside the master?

Re: Reload Editable grid View

not sure. Maybe you can reload master and detail?

Re: Reload Editable grid View

Yes it is already clear. But the user can see just must wait xxx seconds until it pipe the results.
In the examples, there is a container application that shows how to use a text field and a javascript in another container to load a page. That’s what I mean, a macro, which allows you to do this and can use the user-defined names (master-detail link etc.)
These macros could simply use the Ajax events.
I think of the following macros:
sc_reload () the current page reloads
sc_reload_md (lnk_masterdetail {})

Because there are certainly other possibilities