diff --git a/lam/lib/html.inc b/lam/lib/html.inc index e6d38819..d62cbeb9 100644 --- a/lam/lib/html.inc +++ b/lam/lib/html.inc @@ -4682,6 +4682,10 @@ class htmlResponsiveTable extends htmlElement { private $cssOddRow; /** CSS class for even row numbers */ private $cssEvenRow; + /** onclick code (row number => code) */ + private $onClick = array(); + /** ondoubleclick code (row number => code) */ + private $onDoubleClick = array(); /** * Creates the table. @@ -4739,7 +4743,15 @@ class htmlResponsiveTable extends htmlElement { if (!empty($cssClasses)) { $cssClass = ' class="' . implode(' ', $cssClasses) . '"'; } - echo ''; + $onClick = ''; + if (!empty($this->onClick[$counter])) { + $onClick = ' onclick="' . $this->onClick[$counter] . '"'; + } + $onDoubleClick = ''; + if (!empty($this->onDoubleClick[$counter])) { + $onDoubleClick = ' ondblclick="' . $this->onDoubleClick[$counter] . '"'; + } + echo ''; for ($i = 0; $i < $titleCount; $i++) { echo ''; $ids = parseHtml($module, $row[$i], $values, $restricted, $tabindex, $scope); @@ -4770,6 +4782,24 @@ class htmlResponsiveTable extends htmlElement { $this->cssEvenRow = $evenClass; } + /** + * Sets the onclick code for the rows. + * + * @param array $calls row number => code + */ + public function setOnClickEvents($calls) { + $this->onClick = $calls; + } + + /** + * Sets the ondoubleclick code for the rows. + * + * @param array $calls row number => code + */ + public function setOnDoubleClickEvents($calls) { + $this->onDoubleClick = $calls; + } + }