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')