This commit is contained in:
pro.boooooo
2023-03-09 13:43:15 +01:00
parent d31043cce5
commit aaf5fa3aba
7 changed files with 183 additions and 13 deletions

View File

@@ -5,6 +5,7 @@ export default class View {
this.title = document.getElementById("selector-top-title")
this.zone = document.getElementById("selector-list-zone")
this.path = document.getElementById("location")
this.etab = document.getElementById("etab")
this.btn = document.getElementById("selector-top-btn")
this.btn.onclick = () => {
this.updateMenu("", "previous")
@@ -58,6 +59,70 @@ export default class View {
log("Loc->View", `Chemin change ${path}`)
}
renderEtab(data) {
this.etab.innerHTML = ""
let table = document.createElement("table")
let trow = document.createElement("tr")
let th1 = document.createElement("th")
th1.innerText = "Nom"
let th2 = document.createElement("th")
th2.innerText = "Ville"
let th3 = document.createElement("th")
th3.innerText = "Dpt"
let th4 = document.createElement("th")
th4.innerText = "Moyenne"
let th5 = document.createElement("th")
th5.innerText = "Selectivite"
trow.appendChild(th1)
trow.appendChild(th2)
trow.appendChild(th3)
trow.appendChild(th4)
trow.appendChild(th5)
table.appendChild(trow)
data.forEach((e) => {
let etab = e.fields.g_ea_lib_vx
let dept = e.fields.dep
let city = e.fields.ville_etab
let moy = "null"
let selection = "null"
let tr = document.createElement("tr")
let td1 = document.createElement("td")
td1.innerText = etab
let td2 = document.createElement("td")
td2.innerText = city
let td3 = document.createElement("td")
td3.innerText = dept
let td4 = document.createElement("td")
td4.innerText = moy
let td5 = document.createElement("td")
td5.innerText = selection
tr.appendChild(td1)
tr.appendChild(td2)
tr.appendChild(td3)
tr.appendChild(td4)
tr.appendChild(td5)
table.appendChild(tr)
})
this.etab.appendChild(table)
}
/**
* Envoyer dans le controlleur tous les events fait.
* @param { string } selection Ce qu'on va utiliser pour le &refine.