Get value of column from selected row of cgridiview

Hi again Guys.

I did the following:

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

	'dataProvider'=>$dados_ponto,


	'ajaxUpdate'=>true,


	'columns'=>array(


		'codigo_cadfu',


		'hora_registro',


		


	'selectionChanged'=>'function(id)


	{


			var sel_row=$.fn.yiiGridView.getSelection(id);


			alert(sel_row);	


	}'


		


	));

And the result of my alert was (029,001,01,02227901,2012-04-18,2012-04-18 17:57:05)

How do I get one of these values ​​separately?

Thank you!

seems like simple javascript array, so:

sel_row[0] = 029;

sel_row[1] = 001;

sel_row[2] = 01;

Hello. It’s weird.

Normally you should obtain the row number with your code… Is it what you want to get?

Also I don’t know if you’ve pasted your code exactly as it is, but anyway I have 1 comment and 1 correction:


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

  'dataProvider'=>$dados_ponto,

  'ajaxUpdate'=>true, // Do you need this line? It's by default I think

  'columns'=>array(

    'codigo_cadfu',

    'hora_registro',

  ), // You need this line

  'selectionChanged'=>'function(id)

  {

    var sel_row=$.fn.yiiGridView.getSelection(id);

    alert(sel_row);	

  }'

));




'selectionChanged'=>'function(id)

{

   var sel_row=$.fn.yiiGridView.getSelection(id);

   alert(sel_row[0]);

}'

));

Thank you very much for your reply, but this way the result is the same.


Can someone help?


Thanks.