From 66d90ac15beef5143add30b41c628eb92eb16256 Mon Sep 17 00:00:00 2001 From: amazuecos Date: Thu, 23 Jan 2025 00:51:01 +0100 Subject: [PATCH] fix js in tarifa new form --- .../manipulado/viewTarifaManipuladoForm.php | 2 +- .../js/safekat/pages/tarifas/tarifaMaquina.js | 43 ++++++++++--------- 2 files changed, 24 insertions(+), 21 deletions(-) diff --git a/ci4/app/Views/themes/vuexy/form/tarifas/manipulado/viewTarifaManipuladoForm.php b/ci4/app/Views/themes/vuexy/form/tarifas/manipulado/viewTarifaManipuladoForm.php index 3603cdca..87eef817 100644 --- a/ci4/app/Views/themes/vuexy/form/tarifas/manipulado/viewTarifaManipuladoForm.php +++ b/ci4/app/Views/themes/vuexy/form/tarifas/manipulado/viewTarifaManipuladoForm.php @@ -71,7 +71,7 @@
- "tarifa_maquina_component","tarifaId" => $tarifaManipuladoEntity->id ]) ?> + "tarifa_maquina_component","tarifaId" => $tarifaManipuladoEntity?->id ]) ?>
diff --git a/httpdocs/assets/js/safekat/pages/tarifas/tarifaMaquina.js b/httpdocs/assets/js/safekat/pages/tarifas/tarifaMaquina.js index ec23428e..6ebee9e7 100644 --- a/httpdocs/assets/js/safekat/pages/tarifas/tarifaMaquina.js +++ b/httpdocs/assets/js/safekat/pages/tarifas/tarifaMaquina.js @@ -24,26 +24,29 @@ class TarifaMaquina { } init() { - // this.btnNewTarifaMaquina.prop("disabled",true) - this.selectMaquinaTarea.init() - this.selectTarifaMaquina.init() - this.datatable = this.datatableItem.DataTable({ - processing: true, - layout: { - topStart: 'pageLength', - topEnd: 'search', - bottomStart: 'info', - bottomEnd: 'paging' - }, - serverSide: true, - pageLength: 25, - language: { - url: "/themes/vuexy/vendor/libs/datatables-sk/plugins/i18n/es-ES.json" - }, - columns: this.datatableColumns, - ajax: `/tarifas/maquinas/${this.type}/datatable/${this.tarifaId}` - }); - this.events(); + if (this.tarifaId) { + + // this.btnNewTarifaMaquina.prop("disabled",true) + this.selectMaquinaTarea.init() + this.selectTarifaMaquina.init() + this.datatable = this.datatableItem.DataTable({ + processing: true, + layout: { + topStart: 'pageLength', + topEnd: 'search', + bottomStart: 'info', + bottomEnd: 'paging' + }, + serverSide: true, + pageLength: 25, + language: { + url: "/themes/vuexy/vendor/libs/datatables-sk/plugins/i18n/es-ES.json" + }, + columns: this.datatableColumns, + ajax: `/tarifas/maquinas/${this.type}/datatable/${this.tarifaId}` + }); + this.events(); + } } events() { this.btnNewTarifaMaquina.on("click", this.handleNewTarifaMaquina.bind(this));