Page 1 of 1

Reload main form on subform change?

Posted: Fri Feb 27, 2015 10:45 am
by Tinka
I have made an edit button for each subform row, that will open an edit form for this record in an iFrame popup, changing the code slightly from this post:
http://forums.nubuilder.cloud/viewtopic.p ... 0d5#p12970
The reason for this is some validation in the JS section with nuBeforeSave and that the subform rows are read-only as default.

On the JS main form:

Code: Select all

//edit button on subform
function openChild(t){

   var rw  = $('#' + t.id).attr('data-prefix')   //-- current row in subform
   var id  = rw + '_nuPrimaryKey';               //-- Primary Key for record in subform
   var fpk = '5361ec013b6ca4f';                  //-- Form Primary Key
   var rpk = $('#' + id).val();                  //-- Record Primary Key

   
 nuOpenFormInFrame(fpk,rpk); //--open form in floating window


}
OnClick event of Edit button

Code: Select all

openChild;
On AfterSave of subform record Edit form:

Code: Select all

$js = " 
function detect(){
if (nuFORM.edited){
    nuSetHash('chg','1');
var det = 1  
return det;
}
}
nuRemoveModal(); //--close frame


       ";

nuAddJavascript($js);

This part works.

Now I want to reload the main form, when the subform record was changed to show the changes in the subform.
Essentially what the reload button in the lower right corner does, but without omitting any other changes by the user on the main form!
I played around with functions and nuSetHash in AfterSave of the subform, and in the Javascript of the main form, but it doesn't work.
How can I achieve this? Essentially the same functionality like if the "Add record" button was clicked on a lookup and the values are sent back to the lookup and then to the main form.

Tinka

Re: Reload main form on subform change?

Posted: Tue Mar 17, 2015 3:51 am
by admin
Tinka,

I understand your question but at the moment I don't have an answer.

Steven

Re: Reload main form on subform change?

Posted: Fri Jun 17, 2016 8:00 am
by TirasX
Hello,

is there any update on that request?

Thanks.

Re: Reload main form on subform change?

Posted: Fri Jun 24, 2016 4:07 am
by admin
No