Add display options to static datatables

This commit is contained in:
Stephen Abello
2021-03-08 16:09:38 +01:00
parent ef871fba7f
commit b300b76783
3 changed files with 43 additions and 4 deletions

View File

@@ -58,6 +58,10 @@ class StaticTable extends UIContentBlock
private $aExtraParams;
/*@var string $sUrlForRefresh*/
private $sFilter;
/** @var array $aOptions
* List of specific options for display datatable
*/
private $aOptions;
public function __construct(string $sId = null, array $aContainerCSSClasses = [], array $aExtraParams = [])
{
@@ -65,6 +69,7 @@ class StaticTable extends UIContentBlock
$this->aColumns = [];
$this->aData = [];
$this->aExtraParams = $aExtraParams;
$this->aOptions = [];
}
/**
@@ -122,4 +127,34 @@ class StaticTable extends UIContentBlock
$('#".$this->sId."').dataTable().fnAddData(data);
});";
}
/**
* @return mixed
*/
public function GetOption(string $sOption)
{
if (isset($this->aOptions[$sOption])) {
return $this->aOptions[$sOption];
}
return null;
}
/**
* @return array
*/
public function GetOptions(): array
{
return $this->aOptions;
}
/**
* @param array $aOptions
*
* @return $this
*/
public function SetOptions($aOptions)
{
$this->aOptions = $aOptions;
return $this;
}
}