From a5030e5116ffb7430d65689473fefdf8146dcb15 Mon Sep 17 00:00:00 2001 From: sgiehl <stefan@piwik.org> Date: Tue, 5 Jan 2016 00:57:04 +0100 Subject: [PATCH] fix calculation of fillup columns for subtables --- plugins/Actions/javascripts/actionsDataTable.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/plugins/Actions/javascripts/actionsDataTable.js b/plugins/Actions/javascripts/actionsDataTable.js index ad64445c22..ef8442e1bd 100644 --- a/plugins/Actions/javascripts/actionsDataTable.js +++ b/plugins/Actions/javascripts/actionsDataTable.js @@ -318,7 +318,12 @@ $('tr#' + idToReplace, root).after(response).remove(); - var missingColumns = (response.prev().find('td').size() - response.find('td').size()); + var requiredColumnCount = 0, availableColumnCount = 0; + + response.prev().find('td').each(function(){ requiredColumnCount += $(this).attr('colspan') || 1; }); + response.find('td').each(function(){ availableColumnCount += $(this).attr('colspan') || 1; }); + + var missingColumns = requiredColumnCount - availableColumnCount; for (var i = 0; i < missingColumns; i++) { // if the subtable has fewer columns than the parent table, add some columns. // this happens for example, when the parent table has performance metrics and the subtable doesn't. -- GitLab