Hi!
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:
<script>
function obtenerSeleccion(){
var idCliente = $.fn.yiiGridView.getSelection('reclamos-cliente-grid');
var selectedRowElements = $("#reclamos-cliente-grid .items tbody tr.selected td");
if(selectedRowElements.length > 0 )
alert(selectedRowElements[1]);
...
This is my grid widget
<?php
$this->widget('zii.widgets.grid.CGridView', array(
'id'=>'reclamos-cliente-grid',
'selectableRows'=>1,
'selectionChanged'=>'obtenerSeleccion', // via 1: para mostrar detalles al seleccionar
'dataProvider'=>Cliente::model()->search(),
'filter'=>Cliente::model(),
'columns'=>array(
'idCliente',
'apellidos',
'nombres',
'calle',
'numeroPuerta',
//'piso',
//'dpto',
'localidad',
'provincia',
//'codigoPostal',
//'telefono',
//'email',
//'tipoPlan',
//'observaciones',
),
));
?>
Thanks!