【发布时间】:2021-09-01 08:29:15
【问题描述】:
我试图让复选框出现在我的视图的整个列中。但是,我对所述专栏的“价值”有点迷茫。截至目前,我完全不知道需要输入什么才能使复选框出现在整个列中。
感谢任何帮助或建议。下面是我目前写的代码。
$this->widget('zii.widgets.grid.CGridView', array(
'id'=>'ServiceDataProvider',
'dataProvider'=>$model->search(),
'cssFile' => false,
'filter'=>$model,
'columns'=>array(
array(
'header'=>'Affected Groups',
'value'=>'displayGroupName($data->groups)',
'name'=>'groups.description',
'filter'=>CHtml::textField('groups.description', Yii::app()->request->getParam('groups.description'))
),
array(
'header'=>'Affected Hosts',
'value'=>'displayHostName($data->hosts)',
'name'=>'hosts.hostname',
'filter'=>CHtml::textField('hosts.hostname', Yii::app()->request->getParam('hosts.hostname'))
),
array(
'name'=>'servicedescription',
),
array(
'class'=>'CButtonColumn',
'template'=>'{delete}',
'deleteButtonUrl'=>'Yii::app()->createUrl("path/to/delete",
array("id"=>$data["idservice"]))',
),
array(
'value'=>'', // AND this is the part where I have no clue what to do.
'id'=>'selectServices',
'header'=>'<input id="services_all" type="checkbox" title="Select multiple services to dele" data-toggle="tooltip"/>',
'headerHtmlOptions'=>array(
'class'=>'checkbox-column'
),
),
),
));
感谢您的帮助,伙计们。我真的很感激。
【问题讨论】: