subir cambios antes de update

This commit is contained in:
jaimejimenezortega
2024-05-07 17:55:10 +02:00
parent 5ef1360565
commit 8009d34955
8 changed files with 109 additions and 11 deletions

View File

@ -30,4 +30,11 @@
</div>
</div>
</div>
<?= $this->section("additionalInlineJs") ?>
window.routes_direcciones = {
direcciones: "<?= route_to('getDirecciones') ?>",
}
<?= $this->endSection() ?>

View File

@ -1,3 +1,30 @@
function initDirecciones() {
data = {
id: $('#clienteId').val()
},
data = Object.assign(data, window.token_ajax)
$.ajax({
url: window.routes_direcciones.direcciones,
type: 'POST',
data: data,
success: function(response) {
$("#direcciones").empty();
$.each(response.menu, function(key, value) {
$('#direcciones')
.append($('<option>', { value : key })
.text(value));
});
$('#direcciones').val();
},
error: function() {
$("#direcciones").empty();
},
});
}
function initTiradasDirecciones() {
const _this = this
@ -61,6 +88,13 @@ function updateTiradasDireccionesCheck(el) {
}
}
$('#direcciones').on('change', function() {
if( $('#direcciones').val() == 0 ) {
console.log("Nueva direccion")
}
})
$('#insertarDireccion').on('click', function() {
//if( ('#direcciones').val() > 0 ) {

View File

@ -208,6 +208,7 @@
}
}).on('core.form.valid', function () {
validationStepper.next();
initDirecciones();
initTiradasDirecciones();
});