From 6787c62caa469e36bddf5d053c2413a32fea8c42 Mon Sep 17 00:00:00 2001 From: phl0 Date: Sat, 27 May 2023 14:52:55 +0200 Subject: [PATCH] Make contest table use padding for SRX and STX --- assets/js/sections/contesting.js | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/assets/js/sections/contesting.js b/assets/js/sections/contesting.js index 6d37d09f..c2b0b2d9 100644 --- a/assets/js/sections/contesting.js +++ b/assets/js/sections/contesting.js @@ -528,7 +528,21 @@ function restoreContestSession(data) { "scrollCollapse": true, "paging": false, "scrollX": true, - order: [0, 'desc'] + order: [0, 'desc'], + "columnDefs": [ + { + "render": function ( data, type, row ) { + return pad(row[8],3); + }, + "targets" : 8 + }, + { + "render": function ( data, type, row ) { + return pad(row[9],3); + }, + "targets" : 9 + } + ] }); } } @@ -538,3 +552,8 @@ function restoreContestSession(data) { $("#exch_serial_s").val("1"); } } + +function pad (str, max) { + str = str.toString(); + return str.length < max ? pad("0" + str, max) : str; +}