adding url params vaccine and symptom

This commit is contained in:
Frank Knoll
2024-07-14 00:32:36 +02:00
parent 52d724afaa
commit 214510bc33
4 changed files with 66 additions and 40 deletions

View File

@@ -5,34 +5,25 @@ class PageInitializer {
PageInitializer.#configureVaccine(vaccine);
}
static #configureSymptom({ symptomSelectElement, prrByVaccineTableElement, downloadPrrByVaccineTableButton, keyColumnName }) {
static #configureSymptom({ symptomSelectElement, selectSymptom, prrByVaccineTableElement, downloadPrrByVaccineTableButton, keyColumnName }) {
const prrByVaccineTableView = new PrrByVaccineTableView(prrByVaccineTableElement, downloadPrrByVaccineTableButton, keyColumnName);
PageInitializer.#initializeSelectElement(
Select2.initializeSelectElement(
{
selectElement: symptomSelectElement,
textOfOption2Select: selectSymptom,
onValueSelected: (id, text) => prrByVaccineTableView.displayPrrByVaccineTable4Symptom(id, text),
minimumInputLength: 0
});
}
static #configureVaccine({ vaccineSelectElement, prrBySymptomTableElement, downloadPrrBySymptomTableButton, valueName }) {
static #configureVaccine({ vaccineSelectElement, selectVaccine, prrBySymptomTableElement, downloadPrrBySymptomTableButton, valueName }) {
const prrBySymptomTableView = new PrrBySymptomTableView(prrBySymptomTableElement, downloadPrrBySymptomTableButton, valueName);
PageInitializer.#initializeSelectElement(
Select2.initializeSelectElement(
{
selectElement: vaccineSelectElement,
onValueSelected: (id, text) => prrBySymptomTableView.displayPrrBySymptomTable4Vaccine(id ,text),
textOfOption2Select: selectVaccine,
onValueSelected: (id, text) => prrBySymptomTableView.displayPrrBySymptomTable4Vaccine(id, text),
minimumInputLength: 0
});
}
static #initializeSelectElement({ selectElement, onValueSelected, minimumInputLength }) {
selectElement.select2({ minimumInputLength: minimumInputLength });
selectElement.on(
'select2:select',
function (event) {
const id = event.params.data.id;
const text = event.params.data.text;
onValueSelected(id, text);
});
}
}