From 28d0071d474b0c11eef8a568ee3bb165cc6637fb Mon Sep 17 00:00:00 2001 From: Zhangyu Date: Tue, 21 May 2024 09:28:34 +0000 Subject: [PATCH] * zin: modify setLineIndex function of thinktableinput. --- lib/zin/wg/thinktableinput/js/v1.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/lib/zin/wg/thinktableinput/js/v1.js b/lib/zin/wg/thinktableinput/js/v1.js index 00a1edf376..737ff22d6e 100644 --- a/lib/zin/wg/thinktableinput/js/v1.js +++ b/lib/zin/wg/thinktableinput/js/v1.js @@ -20,11 +20,12 @@ window.changeInput = function(e) */ function setLineIndex() { - let index = 0; + let index = 1; $('.rows-group').each(function() { - $(this).find('[name^="fileds"]').attr('name', 'fileds[' + index + ']'); - $(this).find('[name^="result"]').attr('name', 'result[' + index + ']'); + const resultIndex = fieldsCount + index - 1; + $(this).find('[id^="customFields"]').attr('name', 'customFields[' + index + ']'); + $(this).find('[id^="result"]').attr('name', 'result[' + resultIndex + ']'); index ++; }); $('.add-rows').toggleClass('disabled', index >= canAddRows);