This topic is locked

Master refresh when child is updated

8/6/2019 11:46:27 AM
ASPRunner.NET General questions
E
erosolmi author

ASPRunner.Net

I've a page where the master record has some calculated fields from a view (mainly SUM(NumericFields) ).

Child records are updated but master record do not reflect the values updated.

Only if I refresh the page all is ok
Is there a way (event) to instruct master record to refresh its data without refreshing all the page?
Thanks a lot

Eros
Situation before updating is ok


Situation after updating ... is ok in the local total but master calculated field is not ok

I
i.NoLim 8/6/2019

I recently needed something similar, the best option I could find was to refresh the page automatically instead of having the user refresh manually.
In the List Page of the child table, under the JavaScript Onload event, I added the following:



this.on('afterInlineAdd', function( fieldsData ) {

location.reload();

} )
this.on('afterInlineEdit', function( fieldsData ) {

location.reload();

} )


Additionally, the manual has the following but I've never tried it.



To refresh grid on the List page without page reloading, use the following code in Javascript OnLoad event. Note that option AJAX search, pagination and sorting should be enabled (Choose pages -> List page settings).



Runner.runnerAJAX(Runner.pages.getUrl(pageObj.tName, pageObj.pageType)+"?a=return",

pageObj.ajaxBaseParams,

function(respObj){

pageObj.pageReloadHn.call(pageObj, respObj)

});


E
erosolmi author 8/7/2019

i.NoLim thanks a lot.
Your solution works fine reloading the full page.

It is not the perfect solution because it close the sub grid.

But considering that in my specific case sub grid has just one line for the 80% of the cases ... it is ok.
If I will find some other ways I will post here for others.
Thanks again

Eros

admin 8/7/2019

We do not have an option to update master record info without reloading the whole page. We will add an API for this purpose at some point.

T
Tim 8/21/2019



We do not have an option to update master record info without reloading the whole page. We will add an API for this purpose at some point.


This will be a very useful API. I look forward to it's inclusion. Thanks!