Yii Framework Forum: deleteConfirmation codition? - Yii Framework Forum

Jump to content

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

deleteConfirmation codition? Rate Topic: -----

#1 User is offline   fastcrash 

  • Standard Member
  • PipPip
  • Yii
  • Group: Members
  • Posts: 245
  • Joined: 10-March 10
  • Location:South Jakarta

Posted 04 May 2010 - 11:30 PM

hey all,

i want to set condition for deleteConfirmation value in CGridView but its not work, why?
this mycode :

array(
	'class'=>'CButtonColumn',
	'deleteConfirmation'=>$data->Status == "0" ? "sure change status to notactive?" : "sure change status to active?",
	'htmlOptions'=>array('style'=>'letter-spacing:3px;width:80px;text-align:center'),
),


big thanks..
0

#2 User is offline   Mike 

  • Elite Member
  • PipPipPipPipPip
  • Yii
  • Group: Members
  • Posts: 3,013
  • Joined: 06-October 08
  • Location:Upper Palatinate

Posted 05 May 2010 - 01:07 AM

You can't use $data here as this message is only set once for the whole grid and not when looping over the rows. So you have to think about a custom solution.

My try would be: Use cssClassExpression to add active to the cell class when $data->Status!=0 and use a one liner jQuery for your custom confirmation that checks for that class.
0

#3 User is offline   fastcrash 

  • Standard Member
  • PipPip
  • Yii
  • Group: Members
  • Posts: 245
  • Joined: 10-March 10
  • Location:South Jakarta

Posted 05 May 2010 - 01:29 AM

this message is only set once for the whole grid and not when looping over the rows


oh i see,

thank u mike :o
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