list noDataDisabled option

This commit is contained in:
Yuri Kuznetsov
2022-07-01 16:24:39 +03:00
parent 2fe09b5f40
commit ebd859e4d2
2 changed files with 14 additions and 4 deletions

View File

@@ -192,5 +192,7 @@
{{/if}}
{{else}}
{{#unless noDataDisabled}}
<div class="no-data">{{translate 'No Data'}}</div>
{{/unless}}
{{/if}}

View File

@@ -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;