Yii Framework Forum: CGridView data column value - Yii Framework Forum

Jump to content

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

CGridView data column value Rate Topic: -----

#1 User is offline   JamesBarnsley 

  • Master Member
  • PipPipPipPip
  • Yii
  • Group: Members
  • Posts: 613
  • Joined: 18-November 10
  • Location:UK

Posted 15 December 2011 - 06:03 AM

Hi,

I need to put a link in the CGridView.

I am not putting the link in a CLinkColumn as the link needs to call a javascript function and the "linkHtmlOptions" property of the CLinkColumn does not appear to be working for me.

array(
	"header" => "Options",
	"type" => "raw",
	'value' => '<a href="#">link</a>'
)


This does not work either.

Basically my requirement is to put a link with a call to a javascript function in the CGridView can this be done?
0

#2 User is offline   Joblo 

  • Master Member
  • PipPipPipPip
  • Yii
  • Group: Members
  • Posts: 703
  • Joined: 12-September 10
  • Location:Austria

Posted 15 December 2011 - 06:39 AM

Maybe this wiki article helps.
0

#3 User is offline   yiqing95 

  • Master Member
  • PipPipPipPip
  • Yii
  • Group: Members
  • Posts: 607
  • Joined: 27-December 10
  • Location:china

Posted 15 December 2011 - 06:55 AM

yes absolutely , try this:
    array(
                                                         "header" => "Options",
                                                         "type" => "raw",
                                                         'value' => 'CHtml::link("link","#",array("onclick"=>"alert()"))',
                                                     ),




be careful to the double quotes :lol:
2

#4 User is offline   monk 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 13
  • Joined: 22-March 11

Posted 04 January 2012 - 11:42 AM

that should work
0

#5 User is offline   Chayowo 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 3
  • Joined: 28-October 13

Posted 11 December 2013 - 05:34 AM

ya it will work
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