title: CArrayDataProvider with CGridView pagination Yii
body: <p>I'm trying to do a pagination on a <code>CGridView</code> using <code>CArrayDataProvider</code> (my <code>$rawData</code> is a custom array - not from a DB/model).
  So, In the controller`s action a have the following:</p>
  
  <pre><code>$form = new SearchUser;//here I have SearchUser form that extends CFormModel with the following attributes: 'id', 'name', 'surname', 'phone', 'address'
  $users = array();
  if (isset($_POST['SearchUser'])) {
  ....//prepare users array from my custom source-&gt; not from DB/models etc
  }
  
  $dataProvider=new CArrayDataProvider($users, array(
              'id'=&gt;'id',
              'keys'=&gt;array('name', 'surname', 'phone', 'address'),
              'sort'=&gt;array(
                  'attributes'=&gt;array(
                      'name', 'surname', 'phone', 'address'
                  ),
              ),
              'pagination'=&gt;array(
                  'pageSize'=&gt;15,
              ),
          ));
  </code></pre>
  
  <p>And: </p>
  
  <pre><code>$this-&gt;render('index', array('dataProvider'=&gt;$dataProvider, 'form'=&gt;$form));
  </code></pre>
  
  <p>On index.php I have:</p>
  
  <pre><code>...
  &lt;?php echo CHtml::link('Search','#',array('class'=&gt;'search-button')); ?&gt;
  &lt;div class="search-form" style="display:none"&gt;
  &lt;?php $this-&gt;renderPartial('_search',array(
  'model'=&gt;$form,
  )); ?&gt;
  &lt;/div&gt;&lt;!-- search-form --&gt;
  &lt;?php
  
  $this-&gt;widget('zii.widgets.grid.CGridView', array(
  'dataProvider'=&gt;$dataProvider,
  'columns'=&gt;array(
  
      array(
          'name' =&gt; 'Name',          
          'type' =&gt; 'raw',
          'value' =&gt; 'CHtml::encode(@$data["name"])'
      ),
      array(
          'name' =&gt; 'Surname',          
          'type' =&gt; 'raw',
          'value' =&gt; 'CHtml::encode(@$data["surname"])'
      ),/*
      array(
          'name' =&gt; 'Phone',          
          'type' =&gt; 'raw',
          'value' =&gt; 'CHtml::encode(@$data["phone"])'
      ),*/
      array(
          'name' =&gt; 'Address',          
          'type' =&gt; 'raw',
          'value' =&gt; 'CHtml::encode(@$data["address"])'
      ),
  ),
  'enablePagination'=&gt; true,
  ));
  </code></pre>
  
  <p>The first page is displayed correctly but when I select another page, my filter is lost and all data are displayed in the grid instead of "filtered" ones.</p>