Hi guys.
I can not understand why my code does not work. I want to get all lines that were selected.
This is my cgridview:
$this->widget('zii.widgets.grid.CGridView', array(
'id'=>'grid_aceite',
'ajaxUpdate'=>true,
'dataProvider' => $myValue,
'summaryText'=>'',
'selectableRows'=>NULL,//select more than one
'columns' => array(
array(
'header'=>'Hora Retificada',
//'name'=>'obs',
'value'=>'$data->hora_retificada== null?"":date("H:i:s",strtotime($data->hora_retificada))',
'htmlOptions'=>array('class'=>'hora_retificada'),
),
array(
'header'=>'Justificativa',
'name'=>'$data->justificativa',
'value'=>'$data->justificativa',
'htmlOptions'=>array('class'=>'justificativa'),
),
array
(
'header'=>'Aceitar',
'class'=>'CCheckBoxColumn',
'htmlOptions'=>array('style'=>'text-align:center'),
'id'=>'pontos_aceitos',
),
),
));
Here my button that call the js function to get all rows selected:
echo CHtml::Button ("Aceitar justificativas",
$htmlOptions=array
(
'id'=>'btn_aceitar',
'onclick'=>'aceitar_just();'
)
)
And here my js function:
function aceitar_just()
{
var sel_row=$.fn.yiiGridView.getSelection('grid_aceite');
alert(sel_row);
}
And the result is empty or comma when rows selected > 1.
What i doing wrong?
Thank you!