Hey Tommy
Congratz on the 1k posts o/
The thing is, he wants to add a header to the grid for the button column, your solution would be perfect if he wanted to change the images of the buttons
Cheers
Hey Tommy
Congratz on the 1k posts o/
The thing is, he wants to add a header to the grid for the button column, your solution would be perfect if he wanted to change the images of the buttons
Cheers
Actually I did want to change the images. But to change the header just add:
...
public $header = 'Actions';
...
Hi tri… IMO, this is the easiest solution for setting configuration globally. A big thank you.
Apparantly, when adding this to the View Admin:
<?php
$pageSize=Yii::app()->user->getState('pageSize',Yii::app()->params['defaultPageSize']);
$this->widget('zii.widgets.grid.CGridView', array(
'id'=>'file-grid',
'dataProvider'=>$model->search(),
'columns'=>array(
...,
array(
'class'=>'CButtonColumn',
'header'=>CHtml::dropDownList('pageSize',$pageSize,array(10=>10,20=>20,50=>50,100=>100),array(
'onchange'=>"$.fn.yiiGridView.update('file-grid',{ data:{pageSize: $(this).val() }})",
)),
),
),
)); ?>
Combined with the EButtonColumnWithClearFilters, it breaks the functionality of the clearing of that compenent.
The result is that you can’t clear the filter anymore. Does anyone have a solution for this?
my admin.php looks like this:
$this->widget('zii.widgets.grid.CGridView', array(
'id'=>'coworker-grid',
'dataProvider'=>$model->search(),
'filter'=>$model,
...
array(
'class'=>'EButtonColumnWithClearFilters',
'header'=>CHtml::dropDownList('pageSize',$pageSize,array(10=>10,20=>20,50=>50),
array('onchange'=>"$.fn.yiiGridView.update('coworker-grid',{ data:{pageSize: $(this).val() }})",)),
So instead of using a CButtonColumn.
This solution seems to be broken in Yii 1.1.16. Has anybody found a way to fix it? Thanks!
This pageSize solution is working perfectly fine in 1.1.16. I found the problem (thanks to firebug): My problem was was caused by calls to live(), which is deprecated in the new jQuery shipping with Yii 1.1.16 [now on()].