From 9f595007400816031f7e961a42bc2e9f1bb4d310 Mon Sep 17 00:00:00 2001 From: Manuel Rives Date: Thu, 17 Jun 2021 14:49:53 +0200 Subject: [PATCH 1/2] LPS-134200 Modified clone of SearchContainer addRow in order to get the parent columns cssClasses on the new rows. --- .../resources/META-INF/resources/liferay/search_container.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/modules/apps/frontend-js/frontend-js-aui-web/src/main/resources/META-INF/resources/liferay/search_container.js b/modules/apps/frontend-js/frontend-js-aui-web/src/main/resources/META-INF/resources/liferay/search_container.js index a62196c12b8e1d..662ba3db2348a7 100644 --- a/modules/apps/frontend-js/frontend-js-aui-web/src/main/resources/META-INF/resources/liferay/search_container.js +++ b/modules/apps/frontend-js/frontend-js-aui-web/src/main/resources/META-INF/resources/liferay/search_container.js @@ -101,7 +101,9 @@ AUI.add( var template = instance._table.one('.' + CSS_TEMPLATE); if (template) { - row = template.clone(); + row = template.previous() + ? template.previous().clone() + : template.clone(); var cells = row.all('> td'); From 1e819ab37411e9975563e49fe4d10340c8e1130b Mon Sep 17 00:00:00 2001 From: Manuel Rives Date: Fri, 18 Jun 2021 11:54:51 +0200 Subject: [PATCH 2/2] LPS-134200 Added the possibility to specify the css Class of the cells when inserting a new row with the method addRow of searchContainer. --- .../META-INF/resources/liferay/search_container.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/modules/apps/frontend-js/frontend-js-aui-web/src/main/resources/META-INF/resources/liferay/search_container.js b/modules/apps/frontend-js/frontend-js-aui-web/src/main/resources/META-INF/resources/liferay/search_container.js index 662ba3db2348a7..8221aa97936502 100644 --- a/modules/apps/frontend-js/frontend-js-aui-web/src/main/resources/META-INF/resources/liferay/search_container.js +++ b/modules/apps/frontend-js/frontend-js-aui-web/src/main/resources/META-INF/resources/liferay/search_container.js @@ -92,7 +92,7 @@ AUI.add( instance._parentContainer[action](); }, - addRow(array, id) { + addRow(array, id, columnsCssClasses) { var instance = this; var row; @@ -114,6 +114,12 @@ AUI.add( if (cell) { cell.html(item); + if ( + columnsCssClasses && + columnsCssClasses[index] + ) { + cell.addClass(columnsCssClasses[index]); + } } });