Merge pull request #1571 from ostephens/display-null-option

Added option to toggle show/hide null values in cells in data-table
This commit is contained in:
Antonin Delpeuch 2018-04-19 21:37:00 +02:00 committed by GitHub
commit 0cb2e2a98b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 15 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);
}
@ -134,7 +135,10 @@ 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,14 @@ 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 {