Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

CGridview does not create empty class attribute

fixes #1163 where rowCssClassExpression or rowCssClass could be empty
for certain rows.
  • Loading branch information...
commit 74289854ce23c34b4f05aafa5e450cd8dc788ec7 1 parent 9d58b32
Carsten Brandt authored
Showing with 5 additions and 3 deletions.
  1. +5 −3 framework/zii/widgets/grid/CGridView.php
8 framework/zii/widgets/grid/CGridView.php
View
@@ -568,12 +568,14 @@ public function renderTableRow($row)
if($this->rowCssClassExpression!==null)
{
$data=$this->dataProvider->data[$row];
- echo '<tr class="'.$this->evaluateExpression($this->rowCssClassExpression,array('row'=>$row,'data'=>$data)).'">';
+ $class=$this->evaluateExpression($this->rowCssClassExpression,array('row'=>$row,'data'=>$data));
}
else if(is_array($this->rowCssClass) && ($n=count($this->rowCssClass))>0)
- echo '<tr class="'.$this->rowCssClass[$row%$n].'">';
+ $class=$this->rowCssClass[$row%$n];
else
- echo '<tr>';
+ $class='';
+
+ echo empty($class) ? '<tr>' : '<tr class="'.$class.'">';
foreach($this->columns as $column)
$column->renderDataCell($row);
echo "</tr>\n";
Please sign in to comment.
Something went wrong with that request. Please try again.