From 2db567ab0f1bc53de02b1adce63475a56e27ede7 Mon Sep 17 00:00:00 2001 From: Felix Lohmeier Date: Fri, 8 Mar 2019 20:26:18 +0100 Subject: [PATCH] added facet "Count non-blank records/column" to menu All --- .../modules/core/langs/translation-en.json | 2 ++ .../scripts/views/data-table/data-table-view.js | 17 +++++++++++++++++ 2 files changed, 19 insertions(+) diff --git a/main/webapp/modules/core/langs/translation-en.json b/main/webapp/modules/core/langs/translation-en.json index d823145ae..212798e4f 100644 --- a/main/webapp/modules/core/langs/translation-en.json +++ b/main/webapp/modules/core/langs/translation-en.json @@ -584,6 +584,8 @@ "core-views/blank-rows": "Blank Rows", "core-views/count-non-blank-values": "Count non-blank values/column", "core-views/non-blank-values": "Non-blank values per column", + "core-views/count-non-blank-records": "Count non-blank records/column", + "core-views/non-blank-records": "Non-blank records per column", "core-views/edit-rows": "Edit rows", "core-views/star-rows": "Star rows", "core-views/unstar-rows": "Unstar rows", diff --git a/main/webapp/modules/core/scripts/views/data-table/data-table-view.js b/main/webapp/modules/core/scripts/views/data-table/data-table-view.js index 03af637aa..c7e44b308 100644 --- a/main/webapp/modules/core/scripts/views/data-table/data-table-view.js +++ b/main/webapp/modules/core/scripts/views/data-table/data-table-view.js @@ -684,6 +684,23 @@ DataTableView.prototype._createMenuForAllColumns = function(elmt) { } ); } + }, + { + label: $.i18n('core-views/count-non-blank-records'), + id: "core/count-non-blank-records", + click: function() { + ui.browsingEngine.addFacet( + "list", + { + "name" : $.i18n('core-views/non-blank-records'), + "columnName" : "", + "expression" : "filter(row.columnNames,cn,isNonBlank(if(row.record.fromRowIndex==row.index,row.record.cells[cn].value.join(\"\"),null)))" + }, + { + "scroll" : false + } + ); + } } ] },