mirror of
https://github.com/Combodo/iTop.git
synced 2026-04-20 09:08:42 +02:00
N°2598 - When refreshing a list, loosing page and order - change of dashboard refresh mecanism
This commit is contained in:
49
sources/application/UI/Base/tJSRefreshCallback.php
Normal file
49
sources/application/UI/Base/tJSRefreshCallback.php
Normal 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;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user