This topic is locked
[SOLVED]

 Refresh Page upon SPreadsheet Mode update

3/10/2021 9:59:05 AM
PHPRunner General questions
S
swanside author

Hi all.

I have 1 table called 'POB' with three fields.

Id, Name, Mustered

.
Mustered field is a checkbox and the table is in spreadsheet mode, so Mustered can be checked and unchecked on the fly.
I then have a Custom View of this table called validated which is sorted by Mustered Ascending, so the idea is when the Checkbox for Mustered is checked, somebody viewing on another screen the custom view of validated I want this page to refresh.

I have tried the below form the help, but it dont seem to work for me.

if( !pageObj.myAfterInline ) {

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

pageObj.reload({});

} );

pageObj.myAfterInline = true;

}
A
acpan 3/13/2021


if( !pageObj.myAfterInline ) {

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

pageObj.reload({});

} );

pageObj.myAfterInline = true;

}


The above codes refresh the page after INLINE EDIT is saved, the refresh is done for the person who edited the page via Inline Edit (or Add/Edit in Popup), not for any other screens.
For another person working on another screen to see the changes, one way is to set auto-refresh at fixed intervals in Javascript Onload event:



function autoRefresh() {
// refresh only if the current screen is not in Inline Editing Mode

if( !pageObj.myAfterInline ) {

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

pageObj.reload({});

} );

pageObj.myAfterInline = true;

}
// Run autoRefresh at 10 second interval, skip if the current screen is Editing.

setInterval('autoRefresh()', 10000);


OR



setInterval('autoRefresh()', 10000);

// Call a function every 10000 milliseconds (OR 10 seconds).
// Refresh or reload page.

function autoRefresh() {

location.reload();

}


Some idea above, I have not tested myself.

S
swanside author 3/14/2021

Cheers pal.

I did this in the end

pageObj.reload({a:'reload'});