Edit modal, validation of whole data
This commit is contained in:
@ -165,12 +165,18 @@
|
||||
if (reservations.locks.units !== null) {
|
||||
await reservations.locks.units
|
||||
}
|
||||
const idxs = []
|
||||
unitValues.forEach(unitValue => {
|
||||
const type = unitValue.unit.proyecto_tipo_unidad.tipo_unidad.descripcion
|
||||
const idx = this.add(type)
|
||||
idxs.push(idx)
|
||||
})
|
||||
let i = 0
|
||||
unitValues.forEach(unitValue => {
|
||||
const idx = idxs[i ++]
|
||||
const field = this.components.units.querySelector(`div.unit[data-id="${idx}"]`)
|
||||
$(field.querySelector('div.dropdown.edit_units')).dropdown('set selected', unitValue.unit.id)
|
||||
$(field.querySelector('div.input')).val(unitValue.value)
|
||||
field.querySelector('div.input').querySelector('input').value = unitValue.value
|
||||
})
|
||||
}
|
||||
setup() {
|
||||
|
||||
Reference in New Issue
Block a user