Yii Framework Forum: Deleção de Objetos - Yii Framework Forum

Jump to content

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

Deleção de Objetos apagando objeto via CGridView Rate Topic: -----

#1 User is offline   Leonardo Montenegro 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 67
  • Joined: 05-October 10
  • Location:Nilópolis - RJ

Posted 25 October 2010 - 08:50 AM

Senhores,

Solicito vossa ajuda:

(...)
array('class'=>'CLinkColumn', 'header'=>'Deletar', 'labelExpression'=>'Deletar', 'urlExpression'=>'Yii::app()->controller->createUrl("delete", array("id"=>$data->id))',),
(...)


Este código não esta funcionando no CGridView.
Poderiam me ajudar?

Grato,
Leonardo
Always Learning
0

#2 User is offline   steffen 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 26
  • Joined: 14-December 09
  • Location:Reutlingen, DE

Posted 25 October 2010 - 01:11 PM

Hi Leonardo,

did you try to assign a specific controller for your delete action?

array(
  'class'=>'CLinkColumn',
  'header'=>'Deletar',
  'labelExpression'=>'Deletar',
  'urlExpression'=>'Yii::app()->controller->createUrl("/YOURCONTROLLER/delete", array("id"=>$data->id))',
),


Other idea, if your data provider is CSqlDataProvider then you might try $data['id'] instead of $data->id.

HTH

cheers
Steffen
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