I’m using CSqlDataProvider to provide data for CGridView. It all runs fine until I want to add CButtonColumn column. It resultsl in error:
Trying to get property of non-object
and in the stack there
echo $this->displayExtendedSummary && !empty($this->extendedSummary['columns'])
? $this->parseColumnValue($column, $row) : $column->renderDataCell($row);
at file:
c:\...\yii\framework\zii\widgets\grid\CButtonColumn.php(316)
Any ideas how to deal with that?
EDIT:
Provider:
$provider = new CSqlDataProvider($query, array(
'totalItemCount' => $countRes,
'db' => $this->db,
'keyField' => 'idCall',
'params' => $params,
'pagination' => array(
'pageSize' => 25,
),
'sort' => array(
'attributes' => array(
'idCall, idTime',
),
),
));
In view:
<?php $this->widget('bootstrap.widgets.TbExtendedGridView', array(
'id'=>'call-history-grid',
'type' => 'striped condensed',
'template' => '{pager}{items}{summary}',
'htmlOptions' => array('style' => 'font-size: 0.75em'),
'dataProvider'=>$model->getInviteCallList(),
'columns'=>array(
array(
'header' => '#',
'value' => '$data["idCall"]',
'visible' => 'Yii::app()->user->superuser',
),
array(
'header' => 'Data',
'value' => '$data["callDateTime"]',
),
array(
'class'=>'zii.widgets.grid.CButtonColumn',
),
I use here bootstrap gridview but if I switch to regular CGridView - problem is the same.