From 38d60402c0adebba74e567445e355e89c84109c5 Mon Sep 17 00:00:00 2001 From: amazuecos Date: Sat, 12 Apr 2025 08:00:32 +0200 Subject: [PATCH] constraint btn-edit event inside table not in $(document) --- httpdocs/assets/js/safekat/pages/cliente/clientePedidos.js | 2 +- .../assets/js/safekat/pages/cliente/clientePresupuestos.js | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/httpdocs/assets/js/safekat/pages/cliente/clientePedidos.js b/httpdocs/assets/js/safekat/pages/cliente/clientePedidos.js index 0d5d924d..9f0ef800 100644 --- a/httpdocs/assets/js/safekat/pages/cliente/clientePedidos.js +++ b/httpdocs/assets/js/safekat/pages/cliente/clientePedidos.js @@ -18,7 +18,7 @@ class ClientePedidos { $(this).tab('show'); }); - $(document).on('click', '.btn-edit', function (e) { + $('#tableOfPedidosCliente').on('click', '.btn-edit', function (e) { window.location.href = '/pedidos/edit/' + $(this).attr('data-id'); }); diff --git a/httpdocs/assets/js/safekat/pages/cliente/clientePresupuestos.js b/httpdocs/assets/js/safekat/pages/cliente/clientePresupuestos.js index ad558b0a..07540a54 100644 --- a/httpdocs/assets/js/safekat/pages/cliente/clientePresupuestos.js +++ b/httpdocs/assets/js/safekat/pages/cliente/clientePresupuestos.js @@ -17,8 +17,8 @@ class ClientePresupuestos { $(this).tab('show'); }); - $(document).on('click', '.btn-edit', function (e) { - window.location.href = $('#clienteForm').attr('data-url'); + $(this).attr('data-id'); + $('#tableOfPresupuestosCliente').on('click', '.btn-edit', function (e) { + window.location.href = $('#clienteForm').attr('data-url') + $(this).attr('data-id'); }); const lastColNr = $('#tableOfPresupuestosCliente').find("tr:first th").length - 1;