Print Value From Selected Row Of Cgridview


I need some help. When a row from CGridView is selected, I would like to print the second column value (Client Last name) from that row.

However, I’m not able to get the value from the column. Instead I get “object HTMLTableCellElement”

This is my code:



			function obtenerSeleccion(){

				var idCliente = $.fn.yiiGridView.getSelection('reclamos-cliente-grid');



				var selectedRowElements = $("#reclamos-cliente-grid .items tbody tr.selected td");

				if(selectedRowElements.length > 0 )




This is my grid widget


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



				'selectionChanged'=>'obtenerSeleccion',	// via 1: para mostrar detalles al seleccionar

























Now I’m getting an error: HTMLTableCellElement does not have text property.

What I’m trying to do actually is: below the grid Cgridview, show “Selected client: CLIENT_LAST_NAME”

Perhaps there is a better way compared to what I’m trying to do.

I’ll apreciate your help.


I feel like you should probably be indexing from 0. I didn’t question that when copying your code originally. Try: