Yii Framework Forum: CGridView selectableRows quirk - Yii Framework Forum

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

CGridView selectableRows quirk Rate Topic: -----

#1 User is offline   wyldie 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 29
  • Joined: 22-May 09

Posted 18 February 2010 - 12:12 PM

Not sure if this is intentional, when I set a column to be a CCheckBoxColumn on multiple selectable rows I would have expected the selected rows to conform to the checked status of the corresponding checkbox.

Currently a row alternates the selected class, ignoring the checkbox status. Would be nice if that could be cleaner, I realise one approach would be to captcher the checkbox status ourselves, but for completeness sake I would have thought this would be an expected behaviour.
0

#2 User is offline   Shankar 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 5
  • Joined: 11-August 09

Posted 18 February 2010 - 01:13 PM

Could u insert your code here so I can better understand the problem?
0

#3 User is offline   wyldie 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 29
  • Joined: 22-May 09

Posted 19 February 2010 - 05:49 PM

<?php $this->widget('zii.widgets.grid.CGridView', array(
	'dataProvider'=>$dataProvider,
	'showTableOnEmpty'=>false,
	'selectableRows'=>2,
	'emptyText'=>'Nowt to see.',
	'columns'=>array(
		array(
			'class'=>'CCheckBoxColumn',
			'name'=>'delete',
			'value'=>'$data->id',
			'id'=>'delete'
		),
		array(
			'name'=>'created',
			'header'=>'Date Created',
			'value'=>'Yii::app()->dateFormatter->formatDateTime($data->created, "medium", null)'
		),
	),
)); ?>

0

#4 User is offline   nemo 

  • Standard Member
  • PipPip
  • Yii
  • Group: Members
  • Posts: 142
  • Joined: 24-February 10

Posted 06 March 2010 - 07:56 PM

View Postwyldie, on 19 February 2010 - 05:49 PM, said:

<?php $this->widget('zii.widgets.grid.CGridView', array(
	'dataProvider'=>$dataProvider,
	'showTableOnEmpty'=>false,
	'selectableRows'=>2,
	'emptyText'=>'Nowt to see.',
	'columns'=>array(
		array(
			'class'=>'CCheckBoxColumn',
			'name'=>'delete',
			'value'=>'$data->id',
			'id'=>'delete'
		),
		array(
			'name'=>'created',
			'header'=>'Date Created',
			'value'=>'Yii::app()->dateFormatter->formatDateTime($data->created, "medium", null)'
		),
	),
)); ?>



I need same thing. Can you send action controller and view file too? It will really help me.
0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users