title: How to add select2 extension as filter in CGridView on Yii
body: <p>I'm trying to add in one column of the CGridView a filter with select2 extension following this <a href="https://stackoverflow.com/questions/19209112/how-to-add-select2-extension-column-in-yii-gridview"><em>answer</em></a> but does not work. </p>
  
  <p>My code:</p>
  
  <p><strong>In view vehiculos/admin.php</strong></p>
  
  <pre><code>&lt;?php $this-&gt;widget('zii.widgets.grid.CGridView', array(
  'id'=&gt;'vehiculos-grid',
  'dataProvider'=&gt;$model-&gt;search(),
  'filter'=&gt;$model,
  'columns'=&gt;array(
      'id',
      'placa',
      array(
          'name'=&gt;'asociado_id',
          'value'=&gt;'Vehiculos::model()-&gt;getListNombreCompleto()',
          'type'=&gt;'html',
  
          ),
      'modelo',
      'color',
      array(
  
          'class'=&gt;'CButtonColumn',
      ),
  )));
  </code></pre>
  
  <p><strong>In vehiculos.php Model</strong></p>
  
  <pre><code>public function getListNombreCompleto()
      {
          $nombreCompleto = Contactos::model()-&gt;findAll();
          $data = array();
          foreach ($nombreCompleto as $contacto) {
              $data[$contacto-&gt;id] = $contacto-&gt;nombre;
          }
           $this-&gt;widget('ext.select2.ESelect2',array(
            'name'=&gt;'asociado_id',
            'data'=&gt;$data,
            'htmlOptions'=&gt;array(
            ),
          ));
      }
  </code></pre>
  
  <p><strong>Display Error CException:</strong></p>
  
  <pre><code>Vehiculos and its behaviors do not have a method or closure named "widget".
  </code></pre>