Hi,
Below is a sample gridview.
a) How to place a checkbox at the header and select multiple rows from the grid to delete the selected ones?
b)While uncommetning the lines to place checkbox,showing error as ‘Property “CDataColumn.0” is not defined’. Any help is appreciated.
this->widget(‘zii.widgets.grid.CGridView’, array(
'dataProvider' => $MyModel->search(),
'filter' => $MyModel,
'selectableRows' => 2,
'columns' => array(
/* array(
array(
'id'=>'autoId',
'class'=>'CCheckBoxColumn',
'selectableRows' => '50',
),
), */
array(
'name' => 'DepID',
'type' => 'raw',
'value' => 'CHtml::encode($data->DepID)'
),
array(
'name' => 'DepartmentName',
'type' => 'raw',
'value' => 'CHtml::encode($data->DepartmentName)',
)
),
));