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

@@ -0,0 +1,49 @@
<?php
/*
* @copyright Copyright (C) 2010-2020 Combodo SARL
* @license http://opensource.org/licenses/AGPL-3.0
*/
namespace Combodo\iTop\Application\UI\Base;
use Combodo\iTop\Application\UI\Base\Layout\iUIContentBlock;
use Combodo\iTop\Application\UI\Base\Layout\UIContentBlock;
use Dict;
/**
* Trait tJSRefreshCallback
*
* This brings the ability to a UIBlock to have give the JS to use in order to refresh it
*
* @package Combodo\iTop\Application\UI\Base
* @internal
* @since 3.0.0
*/
trait tJSRefreshCallback {
/** @var string */
protected $sJSRefresh = "";
/**
* @return string
*/
public function GetJSRefresh():string
{
$sJSRefresh = $this->sJSRefresh;
foreach ($this->GetSubBlocks() as $oSubBlock) {
if( $oSubBlock->GetJSRefresh() !="") {
$sJSRefresh =$oSubBlock->GetJSRefresh().'\n'.$sJSRefresh;
}
}
return $sJSRefresh;
}
/**
* @param string $sJSRefresh
*/
public function SetJSRefresh(string $sJSRefresh)
{
$this->sJSRefresh = $sJSRefresh;
}
}