mardi 3 novembre 2015

Restricting selectable row of Yii CGridView to checkbox column

I'm using Yii and I have this CGridView here having a CCheckBoxColumn as part of the columns defined.

this->widget('zii.widgets.grid.CGridView', array(
    'dataProvider' => $dataProvider,
    'filter' => $model,
    'columns' => $columns
    ),
    'selectableRows'=>2
));

Setting the selectableRows to 2 makes clicking any part of the row inside the gridview 'check/uncheck' that row too. This is a useful feature so that the user would no longer need to tick the checkbox icon specially if it is very small.

Unfortunately I need to restrict the checkbox ticking to be toggled only upon clicking the checkbox icon/input element itself or at least the column it is in, and not in any other column of the row. It seems that this feature isn't made yet or won't be and I'm looking somehow to overwrite the Js to achieve this but I don't know where to start. Thanks.




Aucun commentaire:

Enregistrer un commentaire