This topic is locked

Refresh after inline add

6/10/2009 7:17:28 AM
PHPRunner General questions
rjks author

Hallo Support,
Using PHPR 5.0 (Build 689)
I am having problems refreshing a list after an inline add.
I have a child which is added inline, after saving the child I need to update the Master Totals.
After adding a child a trigger in the DB creates a child for the child automatically, works fine.
The Master/Child link of the Child file however isn´t shown until I force a refresh by hand.
How can I do this programmatically.
Thanks in advance
P.S.

This solution doesn´t work!

you can do it editing generated include/inlineedit.js file manually.

Find this code:
calcTotals();
And add following lines just after:
if(!$("a[@id^=save_]",window.parent.document).length)

window.parent.location.href=window.parent.location.href.substr(0,window.parent.l

ocation.href.length-1);

J
Jane 6/10/2009

Hi,
generally you can add your custom JavaScript code in theAfter record added event on the Eventstab.

rjks author 6/10/2009

If I try a refresh with Header I get an error occoured in the Child Table Link, the page is not refreshed.
If I click showall button then all the missing fields and links are shown.
It seems that after a inline add the whole list isn´t refreshed just the inline edit line.
Question: how can I refresh the whole page after inline add?
Thanks for your help
Robert

Hi,

generally you can add your custom JavaScript code in theAfter record added event on the Eventstab.

J
Jane 6/11/2009

Hi,
just use JavaScript code in the After record addedevent:

?><script>

window.location.href=...

</script><?php

M
MaxxaM 7/23/2009

In response to this post, I've tried everything I can think of to make this work...and it doesn't work for my inline edit.
Examples I've tried in my After Record Updated Event:
This one does nothing at all

if ($inline)

{

?><script>

window.location.refresh();

</script><?php

}
Reload causes the page to go into infinite loop

if ($inline)

{

?><script>

window.location.reload();

</script><?php

}
redirecting back to itself generates an error...that I can't tell what it is.

if ($inline)

{

?><script>

window.location.href=window.location.href;

</script><?php

}
Any other suggestions? I need this to refresh because I have in my After Record Process, I check for certain status and change row color based on that. Here is that code(it works fine btw):
if ($data["authorizedBy"] != NULL AND $data["authorized"]==NULL) {

$row["rowstyle"]='style="background:yellow"';

}

if ($data["authorized"]==TRUE) {

$row["rowstyle"]='style="background:lightgreen"';

}

if ($data["status"]=='Denied') {

$row["rowstyle"]='style="background:tomato"';

}
Any help would be greatly appreciated

M
MaxxaM 7/23/2009

Nevermind...I did what Jane suggested and it didn't work the first time, so I modified it and it worked for me...here's the modification:
if(!$("a[@id^=save_]",window.document).length)

window.location.href=window.location.href.substr(0,window.location.href.length-1);
With the parent location in there...it was opening up the Edit page instead of doing an inline edit.