fixed-checkbox-column Fixes checkboxes to maintain the selected state of the entire row via CSS, necessary as of 1.1.3

  1. THIS EXTENSION DOES NOT WORK WITH YII 1.1.5
  2. Documentation
  3. Change Log

THIS EXTENSION DOES NOT WORK WITH YII 1.1.5

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.

Documentation

Requirements
  • Yii 1.1 or above
Installation
  • Extract the release file under protected/extensions
Usage

See 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!

Change Log

July 9, 2010
  • Initial release.
0 0
2 followers
699 downloads
Yii Version: 1.1
License: BSD-2-Clause
Category: User Interface
Tags:
Developed by: MadSkillsTisdale
Created on: Jul 10, 2010
Last updated: 13 years ago

Downloads

show all