ManageTable : add tbody and thead , fix javascript error

This commit is contained in:
Dany De Bontridder 2020-10-04 13:33:15 +02:00
parent 47cb4285d9
commit e2b76d52c4
2 changed files with 7 additions and 1 deletions

View file

@ -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;
}
}

View file

@ -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