noalyss-commit
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Noalyss-commit] [noalyss] 45/119: ManageTable : add tbody and thead , f


From: Dany De Bontridder
Subject: [Noalyss-commit] [noalyss] 45/119: ManageTable : add tbody and thead , fix javascript error
Date: Mon, 26 Oct 2020 18:27:15 -0400 (EDT)

sparkyx pushed a commit to branch master
in repository noalyss.

commit e2b76d52c47b9975219925b9ccef73c890b345f0
Author: Dany De Bontridder <danydb@noalyss.eu>
AuthorDate: Sun Oct 4 13:33:15 2020 +0200

    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 f590702..0961481 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 0c7d3e6..116d61f 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 '<tbody>';
             }
             $row=Database::fetch_array($ret, $i);
             $this->display_row($row);
         }
+        echo '</tbody>';
         echo "</table>";
         if ($this->can_append_row()==TRUE)
         {
@@ -715,6 +717,7 @@ function check()
     function display_table_header()
     {
         $nb=count($this->a_order);
+        echo '<thead>';
         echo "<tr>";
 
         if ($this->can_update_row() && $this->icon_mod=="left")
@@ -745,6 +748,7 @@ function check()
             echo th(" ", 'style="width:40px"  class="sorttable_nosort" ');
         }
         echo "</tr>";
+        echo '</thead>';
     }
     /**
      * set the column to sort by default



reply via email to

[Prev in Thread] Current Thread [Next in Thread]