From e2b76d52c47b9975219925b9ccef73c890b345f0 Mon Sep 17 00:00:00 2001 From: Dany De Bontridder Date: Sun, 4 Oct 2020 13:33:15 +0200 Subject: [PATCH] ManageTable : add tbody and thead , fix javascript error --- html/js/scripts.js | 4 +++- include/lib/manage_table_sql.class.php | 4 ++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/html/js/scripts.js b/html/js/scripts.js index f5907020f..0961481b5 100644 --- a/html/js/scripts.js +++ b/html/js/scripts.js @@ -3081,6 +3081,8 @@ function alert_box(p_message) function alternate_row_color(p_table) { var table_colored=$(p_table); + if (! table_colored.tBodies[0] ) return; + var len = table_colored.tBodies[0].rows.length; var i = 0; var localClass = ""; @@ -3717,4 +3719,4 @@ function json_concat(p_json1,p_json2) } return result; -} \ No newline at end of file +} diff --git a/include/lib/manage_table_sql.class.php b/include/lib/manage_table_sql.class.php index 0c7d3e636..116d61ff3 100644 --- a/include/lib/manage_table_sql.class.php +++ b/include/lib/manage_table_sql.class.php @@ -692,10 +692,12 @@ function check() if ($i==0) { $this->display_table_header(); + echo ''; } $row=Database::fetch_array($ret, $i); $this->display_row($row); } + echo ''; echo ""; if ($this->can_append_row()==TRUE) { @@ -715,6 +717,7 @@ function check() function display_table_header() { $nb=count($this->a_order); + echo ''; echo ""; if ($this->can_update_row() && $this->icon_mod=="left") @@ -745,6 +748,7 @@ function check() echo th(" ", 'style="width:40px" class="sorttable_nosort" '); } echo ""; + echo ''; } /** * set the column to sort by default