fixing: "das Suchfeld in der Tabelle wieder herstellen"

This commit is contained in:
frankknoll
2023-06-11 17:12:10 +02:00
parent 77a11b15d0
commit a08d48dc66
8 changed files with 47 additions and 15 deletions

View File

@@ -1,11 +1,12 @@
class BatchCodeTableInitializer {
initialize({ batchCodeTableElement, showCountriesColumn }) {
initialize({ batchCodeTableElement, showCountriesColumn, showDataTablesFilter }) {
// FK-TODO: show "Loading.." message or spinning wheel.
this.#loadBarChartDescriptions(showCountriesColumn)
.then(barChartDescriptions => {
const batchCodeTable = this.#createEmptyBatchCodeTable(batchCodeTableElement, showCountriesColumn, barChartDescriptions);
this.#setVisibilityOfCountriesColumn(batchCodeTable, showCountriesColumn);
this.#setDataTablesFilter(showDataTablesFilter);
fetch('data/batchCodeTables/Global.json')
.then(response => response.json())
.then(json => {
@@ -35,7 +36,7 @@ class BatchCodeTableInitializer {
searching: true,
search:
{
return: true
return: false
},
processing: true,
deferRender: true,
@@ -137,6 +138,13 @@ class BatchCodeTableInitializer {
.visible(showCountriesColumn);
}
#setDataTablesFilter(isEnabled) {
DataTablesFilter.setDataTablesFilter(
isEnabled ?
DataTablesFilter.FilterState.Enabled :
DataTablesFilter.FilterState.Disabled);
}
#addCountriesColumn(json) {
json.columns.push('Countries');
json.data.forEach(row => row.push(null));