mirror of
https://github.com/Combodo/iTop.git
synced 2026-04-19 00:28:47 +02:00
N°4346 - Restore HTML metadata (data-xxx) on lists in the backoffice
This commit is contained in:
@@ -73,9 +73,14 @@ class AjaxRenderController
|
||||
foreach ($aClassAliases as $sAlias => $sClass) {
|
||||
if (isset($aObject[$sAlias]) && !is_null($aObject[$sAlias])) {
|
||||
$aObj[$sAlias."/_key_"] = $aObject[$sAlias]->GetKey();
|
||||
$aObj[$sAlias."/_key_/raw"] = $aObject[$sAlias]->GetKey();
|
||||
$aObj[$sAlias."/hyperlink"] = $aObject[$sAlias]->GetHyperlink();
|
||||
foreach ($aColumnsLoad[$sAlias] as $sAttCode) {
|
||||
$aObj[$sAlias."/".$sAttCode] = $aObject[$sAlias]->GetAsHTML($sAttCode);
|
||||
$oRawValue = $aObject[$sAlias]->Get($sAttCode);
|
||||
if (is_scalar($oRawValue)) {
|
||||
$aObj[$sAlias."/".$sAttCode."/raw"] = $oRawValue;
|
||||
}
|
||||
}
|
||||
$sObjHighlightClass = $aObject[$sAlias]->GetHilightClass();
|
||||
if (!empty($sObjHighlightClass)) {
|
||||
|
||||
@@ -172,6 +172,17 @@ var oTable{{ sListIDForVarSuffix }} = $('#{{ oUIBlock.GetId() }}').DataTable({
|
||||
attribute_label: "{{ aColumn["attribute_label"] }}"
|
||||
},
|
||||
data: "{{ aColumn["class_alias"] }}/{{ aColumn["attribute_code"] }}",
|
||||
createdCell: function (td, cellData, rowData, row, col) {
|
||||
$(td).attr('data-object-class', '{{ aColumn["object_class"] }}');
|
||||
$(td).attr('data-attribute-label', '{{ aColumn["attribute_label"] }}');
|
||||
{% if aColumn["attribute_code"] != "_key_" %}
|
||||
$(td).attr('data-attribute-code', '{{ aColumn["attribute_code"] }}');
|
||||
$(td).attr('data-attribute-type', '{{ aColumn["attribute_type"] }}');
|
||||
{% endif %}
|
||||
if (rowData["{{ aColumn["class_alias"] }}/{{ aColumn["attribute_code"] }}/raw"]) {
|
||||
$(td).attr('data-value-raw', rowData["{{ aColumn["class_alias"] }}/{{ aColumn["attribute_code"] }}/raw"]);
|
||||
}
|
||||
},
|
||||
render: {
|
||||
display: function (data, type, row) { {{ aColumn["render"]|raw }}},
|
||||
_: "{{ aColumn["class_alias"] }}/{{ aColumn["attribute_code"] }}"
|
||||
|
||||
Reference in New Issue
Block a user