CCheckBoxColumn example

hi,

does anybody know any example for using CCheckBoxColumn? unfortunately i couldn’t find any on google.

i want to use it in CGridView and then according to the ID’s of the checked rows do something with the items (eg. create a pdf file with the selected items). but right now i don’t even know how to access the selected rows.

thx in advance :)

Theres lots of code on yii forum related to CGridView checkbox column.

for now refer,

http://www.yiiframework.com/doc/api/1.1/CCheckBoxColumn

http://www.yiichina.net/forum/index.php/topic/26401-cgridview-check-all-checkboxes/

you can get array of checkbox in your controller and can do any action on that.

you can use following code to see checkbox values,


if(!empty($_POST['selectedItems']))

{

  print_r($_POST['selectedItems']);

}