This topic is locked
[SOLVED]

Refresh Child Record After Add

7/13/2021 10:42:54 PM
PHPRunner General questions
J
JoeB7774 author

Hello. I have a Parent-Child1-Child2 form. When I add a Child1, I would like that record to refresh to show that I have "0" Child2 records (so the user can click on the icon and add a Child2 record). I have verified that my settings show the icon when there are zero records and yet it doesnt show up. Any reason for that or any way to force a refresh of that record?

woodey2002 7/14/2021

Hi There,

Have a look here...

https://xlinesoft.com/phprunner/docs/how_to_control_inline_add_edit_functionality_from_script.htm

How to execute JavaScript code after the Inline Add or Edit

To refresh the List page when inline adding or editing is finished, use the following code in the JavaScript OnLoad event of the List page. This code can also work when Add or Edit pages are displayed in a popup.

  1. Inline Add:

if( !pageObj.myAfterInline ) {
this.on('afterInlineAdd', function( fieldsData ) {
pageObj.reload({});
} );
pageObj.myAfterInline = true;
}

  1. Inline Edit:

if( !pageObj.myAfterInline ) {
this.on('afterInlineEdit', function( fieldsData ) {
pageObj.reload({});
} );
pageObj.myAfterInline = true;
}

Cheers,
J

J
JoeB7774 author 7/15/2021

Worked Perfect. Thanks so much.