diff options
Diffstat (limited to 'plugins/CoreVisualizations/templates/_dataTableViz_htmlTable.twig')
-rw-r--r-- | plugins/CoreVisualizations/templates/_dataTableViz_htmlTable.twig | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/plugins/CoreVisualizations/templates/_dataTableViz_htmlTable.twig b/plugins/CoreVisualizations/templates/_dataTableViz_htmlTable.twig index 1fbbf6517f..a85ee66852 100644 --- a/plugins/CoreVisualizations/templates/_dataTableViz_htmlTable.twig +++ b/plugins/CoreVisualizations/templates/_dataTableViz_htmlTable.twig @@ -20,6 +20,7 @@ {% else %} {%- for rowId, row in dataTable.getRows() -%} {%- set rowHasSubtable = not subtablesAreDisabled and row.getIdSubDataTable() and properties.subtable_controller_action is not null -%} + {%- set rowSubtableId = row.getMetadata('idsubdatatable_in_db')|default(row.getIdSubDataTable()) -%} {%- set isSummaryRow = rowId == constant('Piwik\\DataTable::ID_SUMMARY_ROW') -%} {%- set shouldHighlightRow = isSummaryRow and properties.highlight_summary_row -%} @@ -30,9 +31,10 @@ or not properties.replace_row_with_subtable|default(false) -%} {% if showRow %} - <tr {% if rowHasSubtable %}id="{{ row.getIdSubDataTable() }}"{% endif %} + <tr {% if rowHasSubtable %}id="{{ rowSubtableId }}"{% endif %} {% if row.getMetadata('segment') is not false %} data-segment-filter="{{ row.getMetadata('segment')|e('html_attr') }}"{% endif %} {% if row.getMetadata('url') is not false %} data-url-label="{{ row.getMetadata('url')|rawSafeDecoded }}"{% endif %} + data-row-metadata="{{ row.getMetadata|json_encode|e('html_attr') }}" class="{{ row.getMetadata('css_class') }} {% if rowHasSubtable %}subDataTable{% endif %}{% if shouldHighlightRow %} highlight{% endif %}{% if isSummaryRow %} summaryRow{% endif %}" {% if rowHasSubtable %}title="{{ 'CoreHome_ClickRowToExpandOrContract'|translate }}"{% endif %}> {% for column in properties.columns_to_display %} @@ -45,7 +47,7 @@ {# display subtable if present and showing expanded datatable #} {% if properties.show_expanded|default(false) and rowHasSubtable %} - {% include "@CoreVisualizations/_dataTableViz_htmlTable.twig" with {'dataTable': row.getSubtable(), 'idSubtable': row.getIdSubDataTable()} %} + {% include "@CoreVisualizations/_dataTableViz_htmlTable.twig" with {'dataTable': row.getSubtable(), 'idSubtable': rowSubtableId} %} {% endif %} {%- endfor -%} {% endif %} |