Gridview Select-All Checkbox Column Header Problem

Hello:

I’m using Yii version 1.1.14.

I’m running into a problem with the CCheckboxColumn where the header checkbox is NOT selecting/unselecting all of the checkboxes. Can anyone point me in the right direction? I thought this was fixed back in 1.0.7 like two years ago.

Here is my code:




$eventProvider=new CArrayDataProvider($limited_events,

		        array(

					'keyField'=>'instructor1_id',

					'pagination'=>false,

				)

			);

						

			$this->widget('zii.widgets.grid.CGridView', array(

				'id'=>'i-grid',

				'dataProvider'=>$eventProvider,

				'template'=>"{items}",				

				'selectableRows'=>2,

				'showTableOnEmpty'=>true,		

	

				'columns'=>array(							

					array(							

							'id'=>'selectedItem',

							'header'=>'Select',

							'class'=>'CCheckBoxColumn',

					),

										 

					array(

							'name'=>'school',

							'header'=>'School',

							'type'=>'html',

							'value'=>array($this,'formatSchoolLink'),

					),

					array(

							'name'=>'title',

							'header'=>'Program',

							'type'=>'html',

							'value'=>array($this,'formatProgramLink'),

					),							

					array(

							'name'=>'instructor1',

							'header'=>'Instructors',

							'value'=>array($this,'formatInstructors'),

							'type'=>'html',

					),							

				)

			));



And I’ve attached an example of what the grid looks like when I check off the header checkbox (none of the other are checked).

Thanks so much.

Does this work for everyone else? Am I missing something?

hi #C Hodges, I have the same problem, did you get the solution?

Almost one year. Don’t know if you still here.

You need to add a property.




array(							

'id'=>'selectedItem',

'header'=>'Select',

'class'=>'CCheckBoxColumn',

[color="#FF0000"]'selectableRows'=>2,[/color]

),



You better checked the source code first, if you got any problem.

:)