QuickTable: allow to provide pre-row classes

This commit is contained in:
Thomas Gelf 2015-10-16 18:04:12 +02:00
parent 21c42b9922
commit bbf7796b53
1 changed files with 20 additions and 1 deletions

View File

@ -32,9 +32,28 @@ abstract class QuickTable implements Paginatable
protected $searchColumns = array();
protected function getRowClasses($row)
{
return array();
}
private function getRowClassesString($row)
{
$classes = $this->getRowClasses($row);
if (is_string($classes)) {
$classes = array($classes);
}
if (empty($classes)) {
return '';
} else {
return ' class="' . implode(' ', $classes) . '"';
}
}
protected function renderRow($row)
{
$htm = " <tr>\n";
$htm = " <tr" . $this->getRowClassesString($row) . ">\n";
$firstRow = true;
foreach ($this->getTitles() as $key => $title) {