title: Retain Checkbox values in Yii gridview pagination
body: <p>I have a gridview which contains a checkbox column and also uses pagination. When I check some checkboxes in the first page and navigate to the second page and check another one in the second page, the options I checked in the first page is not retained there. Is it posssible to retain the checkbox values during pagination?</p>
  
  <p><strong>Code for Gridview is</strong> </p>
  
  <pre><code>$widget = $this-&gt;widget('zii.widgets.grid.CGridView', array(
      'dataProvider'     =&gt; $model-&gt;search(),
      'cssFile'          =&gt; Yii::app()-&gt;baseUrl . '/media/js/admin/css/admingridview.css',
      //'filter' =&gt; $model,
      'ajaxUpdate'       =&gt; true,
      'enablePagination' =&gt; true,
      'columns'          =&gt; array(
          array(
              'name'   =&gt; 'id',
              'header' =&gt; '#',
              'value'  =&gt; '$this-&gt;grid-&gt;dataProvider-&gt;pagination-&gt;currentPage * $this-&gt;grid-&gt;dataProvider-&gt;pagination-&gt;pageSize + ($row+1)',
          ),
          array(
              'class'          =&gt; 'CCheckBoxColumn',
              'selectableRows' =&gt; '2',
              'header' =&gt; 'Selected',
          ),
          array(
              'name'   =&gt; 'fb_user_id',
              'header' =&gt; 'FaceBook Id',
              'value'  =&gt; 'CHtml::encode($data-&gt;fb_user_id)',
          ),
          array(
              'name'   =&gt; 'first_name',
              'header' =&gt; 'Name',
              'value'  =&gt; 'CHtml::encode($data-&gt;first_name)',
          ),
          array(
              'name'   =&gt; 'email_id',
              'header' =&gt; 'Email',
              'value'  =&gt; 'CHtml::encode($data-&gt;email_id)',
          ),
          array(
              'name'   =&gt; 'demo',
              'type'   =&gt; 'raw',
              'header' =&gt; "Select",
              'value'  =&gt; 'CHtml::checkBox("email[]","",array("class"=&gt;"check","value"=&gt;$data-&gt;email_id))',
          ),
      ),
  ));
  </code></pre>
  
  <p><strong>Edit:</strong></p>
  
  <p>Extension for remembering the selected options in gridview,check this link <a href="http://www.yiiframework.com/extension/selgridview" rel="nofollow noreferrer">Selgridview</a></p>
  
  <p>Thanks to <strong><em><a href="https://stackoverflow.com/users/720508/bool-dev">bool.dev</a></em></strong></p>