Select/check all checkboxes on selGridView


I need help.

I am using ‘ext.selgridview.SelGridView’ widget in my project and using pagination too.

I can select/check manually some records and can get these items after.

I can uncheck all items, using ‘selGridView(“clearAllSelection”)’.

But I can’t select/check all records on this grid and don’t know how. I’ve got $model->id column, but how can I put this array into selGridView(‘addSelection’, [here!])?



$this->widget('ext.selgridview.SelGridView', array(





            'selectableRows' => 2,

            'enablePagination' => true,

            'enableSorting'=> true,

            'pagerCssClass' => 'text-center',


                'nextPageLabel' => '<span>»</span>',

                'prevPageLabel' => '<span>«</span>',

                'lastPageLabel' => '<span>»»</span>',

                'firstPageLabel' => '<span>««</span>',

                'selectedPageCssClass' => 'active',

                'hiddenPageCssClass' => 'disabled',

                'htmlOptions' => array('class' => 'pagination'),

                'class' => 'CLinkPager',

                'header' => false,

                'pageSize' => 5,








                    'checkBoxHtmlOptions' => array('class' => 'checkclass',),
















        $('#btn-selAllRecords').click(function() {

           $('#dest-list-grid').selGridView('addSelection', [<?php implode(",", $model->id); ?>]);

//but this code doesn't work! <img src='' class='bbc_emoticon' alt=':(' />





I cannot understand, how to take IDs list from CGridView (by Ajax, using afterAjaxUpdate, for exam)? Please, help somebody