this.#displayControlColumn(country == 'Global')

This commit is contained in:
frankknoll
2023-01-31 08:43:01 +01:00
parent 1c995a4087
commit f1f815f070
2 changed files with 8 additions and 3 deletions

View File

@@ -43,7 +43,7 @@
<body> <body>
<span id="forkongithub"><a href="https://github.com/KnollFrank/HowBadIsMyBatch">Fork me on GitHub</a></span> <span id="forkongithub"><a href="https://github.com/KnollFrank/HowBadIsMyBatch">Fork me on GitHub</a></span>
<h1>Batch Codes of Coronavirus 2019 Vaccines</h1> <h1>Batch Codes of Coronavirus 2019 Vaccines</h1>
<p style="display: none;"> <p>
<label>Select country: <label>Select country:
<select id="countrySelect" name="country"> <select id="countrySelect" name="country">
<option selected="" value="Global">Global</option> <option selected="" value="Global">Global</option>

View File

@@ -103,8 +103,9 @@ class BatchCodeTableInitializer {
return json; return json;
}) })
.then(json => { .then(json => {
this.#_setTableRows(json.data) this.#setTableRows(json.data);
this.#selectInput(); this.#selectInput();
this.#displayControlColumn(country == 'Global');
}); });
} }
@@ -113,7 +114,7 @@ class BatchCodeTableInitializer {
json.data.forEach(row => row.unshift(null)); json.data.forEach(row => row.unshift(null));
} }
#_setTableRows(rows) { #setTableRows(rows) {
this.#batchCodeTable this.#batchCodeTable
.clear() .clear()
.rows.add(rows) .rows.add(rows)
@@ -126,6 +127,10 @@ class BatchCodeTableInitializer {
input.select(); input.select();
} }
#displayControlColumn(isVisible) {
this.#batchCodeTable.column(this.#getColumnIndex('control')).visible(isVisible);
}
#initializeHistogramView() { #initializeHistogramView() {
const thisClassInstance = this; const thisClassInstance = this;
$(`#${this.#batchCodeTableElement[0].id} tbody`).on( $(`#${this.#batchCodeTableElement[0].id} tbody`).on(