From 032bd0f338fbc37cff5072972ef71bb123e9f466 Mon Sep 17 00:00:00 2001 From: sparkyx Date: Tue, 8 Mar 2022 09:21:09 +0100 Subject: [PATCH] Fixed : error when column contains only a input element (checkbox) --- html/js/sorttable.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/html/js/sorttable.js b/html/js/sorttable.js index e90e6cf03..a15b1ad33 100644 --- a/html/js/sorttable.js +++ b/html/js/sorttable.js @@ -277,8 +277,8 @@ var sorttable = { hasInputs = (typeof node.getElementsByTagName == 'function') && node.getElementsByTagName('input').length; - - if (node.getAttribute("sorttable_customkey") != null) { + + if (node.getAttribute && node.getAttribute("sorttable_customkey") != null) { return node.getAttribute("sorttable_customkey"); } else if (typeof node.textContent != 'undefined' && !hasInputs) { return node.textContent.replace(/^\s+|\s+$/g, '');