From 0cb5cb50b3c142a2dc6a3c8c625c52d4c76bb5dd Mon Sep 17 00:00:00 2001 From: vadivelJ96 Date: Mon, 21 Apr 2025 17:44:44 +0530 Subject: [PATCH] stock changes 21-04-2025 --- app/Views/editconfig.php | 36 +++++++++++++++++++++++++++--------- 1 file changed, 27 insertions(+), 9 deletions(-) diff --git a/app/Views/editconfig.php b/app/Views/editconfig.php index 1013c078..4cf8da5b 100755 --- a/app/Views/editconfig.php +++ b/app/Views/editconfig.php @@ -157,9 +157,9 @@ if (!empty($master)) { Config_ID === 'C023'){ ?> - + @@ -168,7 +168,7 @@ if (!empty($master)) { - ConfigValue; ?> + ConfigValue; ?> @@ -422,8 +422,6 @@ if (!empty($master)) { }, success: function(data) { - console.log(data); - if (data.length > 0) { if (data[0]?.isActive == 1) { @@ -509,15 +507,17 @@ if (!empty($master)) { var id = $(this).data('id'); var key = $(this).data('key'); var code = $(this).data('code'); - var configValue = $(this).data('configvalue'); + var configValue = $(this).attr('data-configvalue'); + + console.log(configValue); $('#key').val(key); $('#Config_ID').val(code); $('#configValue').val(configValue); - $('#EditConfiguration').modal('show'); - + }); + @@ -541,7 +541,25 @@ if (!empty($master)) { success: function(response) { if (response.status) { alert('Config Value updated successfully'); - location.reload(); + + let key = $('#key').val(); + + let configValue = $("#configValue").val(); + + let configId = $('#Config_ID').val(); + if (configId === "C023") { + $(`#configtable tbody tr td.config-value-td a[data-key="${key}"]`).text(configValue); + } else { + $(`#configtable tbody tr td.config-value-td[data-key="${key}"]`).text(configValue); + } + + $(`#configtable tbody tr td a.editConfigurationBtn[data-key="${key}"]`).attr('data-configvalue', configValue); + + + $("#configValue").val(" "); + + $('#EditConfiguration').modal('hide'); + } else { alert('Failed to update Config Value'); }