How to get selected RadioButton in GridView?

I knew for checkbox, the below way to get the checked list of index:

var key = $(’#grid’).yiiGridView(‘getSelectedRows’);

but what for RadioButtonColumn? is there other api like ‘getSelectedRows’?
I tried it but it not woks for radio.

I’m using checkbox column and you can try it.

                        'class' => 'yii\grid\CheckboxColumn',
                        'checkboxOptions' =>
                            function($model) {
                                return ['value' => $model->id, 'class' => 'checkbox-row', 'id' => 'checkbox'];

to get selected value, i iterate it.

for(var i=0; i < $('#checkbox.checkbox-row').length; i++)
        if($('#checkbox.checkbox-row')[i].checked == true) { ... }

hope it helps

Hi dingqun,

try to use jQuery :checked selector.