The bug notes for this issue indicate there will be a fix in the main branch soon. The initial target was 1.1.5, but now they moved it to 1.1.6. If you must have this patch, please use Yii v1.1.4 or lower, or wait for the official patch
If you really must have it now, message me on the forums and I will see about fixing it for you in the meantime.
This extension is necessary because of a bug in the CCheckboxColumn.
$.fn.yiiGridView.getSelection('yourGridID');
cycles through rows and returns the ids of any rows that have the css class "selected".
The problem is that the check all/uncheck all checkbox in the header of CCheckboxColumn does not maintain this class properly, so the result is that the javascript function can return the wrong rows. FixedcheckboxColumn solves this problem.
protected/extensionsSee the following code example:
Yii::import('application.extensions.FixedCheckboxColumn'); <?php $this->widget('zii.widgets.grid.CGridView', array( 'id'=>'mygrid', 'dataProvider'=>$model->search(), 'selectableRows' => 2, 'filter'=>$model, 'columns'=>array( array( 'class'=>'FixedCheckBoxColumn', 'id' => 'rows_to_change', ), ... ... ), )); All of your javascript, such as $.fn.yiiGridView.getSelection(), is used exactly the same way. The difference is that now it always references rows whose checkboxes are checked!
Total 1 comment
I think that expression
should be replaced with
and also to use it correctly you need handler for the grid's selectionChanged event to check/uncheck checkboxes when user click on row.
Leave a comment
Please login to leave your comment.