mirror of
https://github.com/edcommonwealth/sqm-dashboards.git
synced 2026-03-08 23:18:18 -07:00
Add checkboxes to select academic years for analyze page. Stimulus controller reads the state of the checkboxes and builds the correct link to route the user
This commit is contained in:
parent
607b91c795
commit
16569974a6
5 changed files with 57 additions and 4 deletions
|
|
@ -4,6 +4,18 @@ import { Controller } from "@hotwired/stimulus"
|
|||
export default class extends Controller {
|
||||
connect() { }
|
||||
refresh(event) {
|
||||
window.location = event.target.value
|
||||
let location = event.target.value+ "&academic_years=";
|
||||
let year_checkboxes = document.getElementsByName("year-checkbox");
|
||||
let selected_years = [];
|
||||
|
||||
let ending = "";
|
||||
year_checkboxes.forEach((item)=>{
|
||||
if(item.checked) {
|
||||
selected_years.push(item.id)
|
||||
}
|
||||
})
|
||||
|
||||
console.log(location)
|
||||
window.location = location + selected_years.join(",")
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue