N°3123 - DataTables rework (WIP)

This commit is contained in:
Eric
2020-12-10 17:13:15 +01:00
parent b03c5232b0
commit 2bef89137e
24 changed files with 293 additions and 218 deletions

View File

@@ -80,6 +80,8 @@ abstract class UIBlock implements iUIBlock
protected $aJsFilesRelPath;
/** @var array */
protected $aCssFilesRelPath;
/** @var array Array <KEY> => <VALUE> which will be output as HTML data-xxx attributes (eg. data-<KEY>="<VALUE>") */
protected $aDataAttributes;
/**
* UIBlock constructor.
@@ -97,6 +99,7 @@ abstract class UIBlock implements iUIBlock
$this->aJsTemplateRelPath[self::JS_TYPE_ON_READY] = static::DEFAULT_JS_ON_READY_TEMPLATE_REL_PATH;
$this->sCssTemplateRelPath = static::DEFAULT_CSS_TEMPLATE_REL_PATH;
$this->sGlobalTemplateRelPath = static::DEFAULT_GLOBAL_TEMPLATE_REL_PATH;
$this->aDataAttributes = [];
}
/**
@@ -317,4 +320,37 @@ abstract class UIBlock implements iUIBlock
return $aFiles;
}
/**
* @return array
*/
public function GetDataAttributes(): array
{
return $this->aDataAttributes;
}
/**
* @param array $aDataAttributes
*
* @return $this
*/
public function SetDataAttributes(array $aDataAttributes)
{
$this->aDataAttributes = $aDataAttributes;
return $this;
}
/**
* @param string $sName
* @param string $sValue
*
* @return $this
*/
public function AddDataAttribute(string $sName, string $sValue)
{
$this->aDataAttributes[$sName] = $sValue;
return $this;
}
}