Hello all,
I want to add <colgroup> for the CGridView. Help me, how can I do it.
Thanks
Hello all,
I want to add <colgroup> for the CGridView. Help me, how can I do it.
Thanks
do you mean this groupColumn
see extraRow
By
‘class’=>‘CButtonColumn’,
‘template’=> ‘{view} {update} {delete}’,
‘htmlOptions’=>array(‘style’=>‘width:32px;’, ‘colspan’=>‘0’),
you are able to give your style etc to your coloumns,I think ,it is eqivalent to colgroup,isn’t it,or u want something else,please elaborate more ,what u want.
Not this.
See what I want actually.
<table>
<!-- Want This -->
<colgroup>
<col width='10%'>
<col width='20%'>
<col width='*'>
</colgroup>
<!-- /Want This -->
<!--
CGridView Generated Code Here
-->
</table>
i have the same problem.anybody know the solution? thanks
You would have to extend CGridView and override CGridView::renderItems().
You could create a method called renderColgroup for example and call it right before renderTableHeader()
/**
* Renders the data items for the grid view.
*/
public function renderItems()
{
if($this->dataProvider->getItemCount()>0 || $this->showTableOnEmpty)
{
echo "<table class=\"{$this->itemsCssClass}\">\n";
$this->renderColgroup();
$this->renderTableHeader();
ob_start();
$this->renderTableBody();
$body=ob_get_clean();
$this->renderTableFooter();
echo $body; // TFOOT must appear before TBODY according to the standard.
echo "</table>";
}
else
$this->renderEmptyText();
}