Added option to toggle show/hide null values in cells in data-table

This commit is contained in:
Owen Stephens 2018-04-19 12:00:38 +01:00
parent 716a1606b4
commit 9c05326573
3 changed files with 14 additions and 1 deletions

View File

@ -600,6 +600,7 @@
"view": "View",
"collapse-all": "Collapse all columns",
"expand-all": "Expand all columns",
"display-null": "Show/Hide 'null' values in cells",
"reorder-perma": "Reorder rows permanently",
"by": "By",
"custom-text-trans": "Custom text transform on column",

View File

@ -39,6 +39,7 @@ function DataTableView(div) {
this._collapsedColumnNames = {};
this._sorting = { criteria: [] };
this._columnHeaderUIs = [];
this._shownulls = false;
this._showRows(0);
}
@ -135,6 +136,9 @@ DataTableView.prototype.render = function() {
this._renderDataTables(elmts.table[0], elmts.headerTable[0]);
this._div.empty().append(html);
// show/hide null values in cells
$(".data-table-null").toggle(self._shownulls);
this.resize();
elmts.dataTableContainer[0].scrollLeft = scrollLeft;
@ -741,6 +745,13 @@ DataTableView.prototype._createMenuForAllColumns = function(elmt) {
self._collapsedColumnNames = [];
self.render();
}
},
{
label: $.i18n._('core-views')["display-null"],
id: "core/display-null",
click: function() {
$(".data-table-null").toggle();
self._shownulls = !(self._shownulls);
}
]
}

View File

@ -203,6 +203,7 @@ div.data-table-cell-content-numeric > a.data-table-cell-edit {
.data-table-null {
color: #aaa;
display: none;
}
.data-table-error {