diff --git a/resources/js/dashboards/bigdata.js b/resources/js/dashboards/bigdata.js index 20653e7..1022297 100644 --- a/resources/js/dashboards/bigdata.js +++ b/resources/js/dashboards/bigdata.js @@ -8,10 +8,10 @@ class BigData { try { this.filterYear = new Date().getFullYear(); // Set initial year - let yearInput = document.querySelector("#yearPicker"); + let yearSelect = document.querySelector("#yearPicker"); let filterButton = document.querySelector("#btnFilterYear"); - if (!yearInput || !filterButton) { + if (!yearSelect || !filterButton) { console.error( "Element #yearPicker or #btnFilterYear not found." ); @@ -19,18 +19,15 @@ class BigData { } // Set default value for input - yearInput.value = this.filterYear; + yearSelect.value = this.filterYear; - // Handle manual input (pressing Enter) - yearInput.addEventListener("keypress", (event) => { - if (event.key === "Enter") { - this.updateYear(yearInput.value); - } + yearSelect.addEventListener("change", () => { + this.updateYear(yearSelect.value); }); // Handle button click filterButton.addEventListener("click", () => { - this.updateYear(yearInput.value); + this.updateYear(yearSelect.value); }); console.log("init filter this year", this.filterYear); diff --git a/resources/views/dashboards/bigdata.blade.php b/resources/views/dashboards/bigdata.blade.php index e85123b..11507a5 100644 --- a/resources/views/dashboards/bigdata.blade.php +++ b/resources/views/dashboards/bigdata.blade.php @@ -57,8 +57,14 @@
- - +
+ + +
@component('components.circle', [