From 65a87acc481963cf198b1d4cc23346c8218f9628 Mon Sep 17 00:00:00 2001 From: tracer Date: Thu, 27 Oct 2022 12:13:06 +0200 Subject: [PATCH] fixed a stupid bug breaking the sort of row numbers larger than 9 --- public/assets/js/functions.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/public/assets/js/functions.js b/public/assets/js/functions.js index aa03134..b8120e2 100644 --- a/public/assets/js/functions.js +++ b/public/assets/js/functions.js @@ -109,12 +109,12 @@ function sortBy(column) { for (let i = 1; i < (rows.length - 2); i++) { let x = rows[i] let rowXId = x.id - let rowXNumber = rowXId.charAt(rowXId.length -1) + let rowXNumber = rowXId.match(/\d+/) let valueX = document.getElementById(column + '_' + rowXNumber).value let y = rows[i + 1] let rowYId = y.id - let rowYNumber = rowYId.charAt(rowYId.length -1) + let rowYNumber = rowYId.match(/\d+/) let valueY = document.getElementById(column + '_' + rowYNumber).value let currentSortOrder = document.getElementById(column + '_sort')