答案 0 :(得分:1)
不确定切换输入框和字段名称,但您可以轻松减小列的宽度:
$this->widget('zii.widgets.grid.CGridView', array(
'id'=>'user-grid',
'dataProvider'=>$model->search(),
'filter'=>$model,
'columns'=>array(
array(
'name' => 'id',
'htmlOptions' => array('style'=>'width: 30px;'),
),
//rest of your code
通过查看文档找到如何切换它们只需执行此操作:
$this->widget('zii.widgets.grid.CGridView', array(
'id'=>'user-grid',
'dataProvider'=>$model->search(),
'filter'=>$model,
'filterPosition' => 'header', //ADD THIS LINE
仅供参考,这里是文档:http://www.yiiframework.com/doc/api/1.1/CGridView