Reload main form on subform change?

Reload main form on subform change?

Postby Tinka » Fri Feb 27, 2015 7:15 pm

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.com/viewtopic.php?f=13&t=8473&p=12970&hilit=edit+button&sid=1637c2166b39566948103cbfd26260d5#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
Tinka
 
Posts: 73
Joined: Mon Feb 24, 2014 11:28 pm

Re: Reload main form on subform change?

Postby admin » Tue Mar 17, 2015 12:21 pm

Tinka,

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

Steven
admin
Site Admin
 
Posts: 3348
Joined: Mon Jun 15, 2009 9:53 am

Re: Reload main form on subform change?

Postby TirasX » Fri Jun 17, 2016 3:30 pm

Hello,

is there any update on that request?

Thanks.
TirasX
 
Posts: 8
Joined: Tue Jun 14, 2016 5:59 pm

Re: Reload main form on subform change?

Postby admin » Fri Jun 24, 2016 11:37 am

No
admin
Site Admin
 
Posts: 3348
Joined: Mon Jun 15, 2009 9:53 am


Return to General