From ebd859e4d24fedbd0670ca7ad2e02df454bfe7b4 Mon Sep 17 00:00:00 2001 From: Yuri Kuznetsov Date: Fri, 1 Jul 2022 16:24:39 +0300 Subject: [PATCH] list noDataDisabled option --- client/res/templates/record/list.tpl | 2 ++ client/src/views/record/list.js | 16 ++++++++++++---- 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/client/res/templates/record/list.tpl b/client/res/templates/record/list.tpl index dc9bedb640..2ad5a17f65 100644 --- a/client/res/templates/record/list.tpl +++ b/client/res/templates/record/list.tpl @@ -192,5 +192,7 @@ {{/if}} {{else}} + {{#unless noDataDisabled}}
{{translate 'No Data'}}
+ {{/unless}} {{/if}} diff --git a/client/src/views/record/list.js b/client/src/views/record/list.js index c14f8dbcf2..587d858313 100644 --- a/client/src/views/record/list.js +++ b/client/src/views/record/list.js @@ -36,6 +36,8 @@ function (Dep, MassActionHelper, ExportHelper) { * @name Class * @extends module:view.Class * @memberOf module:views/record/list + * + * @todo Document all options. */ return Dep.extend(/** @lends module:views/record/list.Class# */{ @@ -412,6 +414,13 @@ function (Dep, MassActionHelper, ExportHelper) { */ exportDisabled: false, + /** + * Disable a no-data label (when no result). + * + * @protected + */ + noDataDisabled: false, + /** * @inheritDoc */ @@ -787,6 +796,7 @@ function (Dep, MassActionHelper, ExportHelper) { totalCountFormatted: this.getNumberUtil().formatInt(this.collection.total), moreCountFormatted: this.getNumberUtil().formatInt(moreCount), checkboxColumnWidth: this.checkboxColumnWidth, + noDataDisabled: this.noDataDisabled, }; }, @@ -794,15 +804,13 @@ function (Dep, MassActionHelper, ExportHelper) { * @inheritDoc */ init: function () { - this.listLayout = this.options.listLayout || this.listLayout; - this.type = this.options.type || this.type; - + this.listLayout = this.options.listLayout || this.listLayout; this.layoutName = this.options.layoutName || this.layoutName || this.type; this.layoutScope = this.options.layoutScope || this.layoutScope; this.layoutAclDisabled = this.options.layoutAclDisabled || this.layoutAclDisabled; - this.headerDisabled = this.options.headerDisabled || this.headerDisabled; + this.noDataDisabled = this.options.noDataDisabled || this.noDataDisabled; if (!this.headerDisabled) { this.header = _.isUndefined(this.options.header) ? this.header : this.options.header;