N°2598 - When refreshing a list, loosing page and order - change of dashboard refresh mecanism

This commit is contained in:
acognet
2021-02-15 16:54:46 +01:00
parent 4c23f1f32b
commit dbe747ea23
27 changed files with 422 additions and 346 deletions

View File

@@ -945,8 +945,11 @@ class RuntimeDashboard extends Dashboard
$oAppContext = new ApplicationContext();
$sContext=$oAppContext->GetForPostParams();
//$sContext is named "c" because it use the existing code for context parameters c[org_id] and c[menu]
$oPage->add_script(
<<<EOF
<<<JS
if (typeof(AutoReloadDashboardId$sDivId) !== 'undefined')
{
clearInterval(AutoReloadDashboardId$sDivId);
@@ -960,17 +963,10 @@ class RuntimeDashboard extends Dashboard
// Do not reload when a dialog box is active
if (!($('.ui-dialog:visible').length > 0) && $('.ibo-dashboard#$sDivId').is(':visible'))
{
$('.ibo-dashboard#$sDivId').block();
$.post(GetAbsoluteUrlAppRoot()+'pages/ajax.render.php',
{ operation: 'reload_dashboard', dashboard_id: '$sId', file: '$sFile', extra_params: $sExtraParams, c: $sContext, reload_url: '$sReloadURL'},
function(data){
$('.ibo-dashboard#$sDivId').html(data);
$('.ibo-dashboard#$sDivId').unblock();
}
);
updateDashboard$sDivId();
}
}
EOF
JS
);
}
else