title: Yii select2 - returned data cannot be selected
body: <p>I have been looking into select2 and yii and have managed to load data via json request/response.</p>
  
  <p>The issue I'm faced with is when I try to select an entry of the returned data, I can not.</p>
  
  <p>Where am I going wrong ? The data returnd by the action is json formatted as CustomerCode and Name</p>
  
  <p>Widget code in form  </p>
  
  <pre><code>$this-&gt;widget('bootstrap.widgets.TbSelect2', array(  
      'asDropDownList' =&gt; false,  
      'name' =&gt; 'CustomerCode',  
      'options' =&gt; array(     
          'placeholder' =&gt; 'Type a Customer Code',  
                  'minimumInputLength' =&gt; '2',  
          'width' =&gt; '40%',  
                  'ajax' =&gt; array(  
                                  //'url'=&gt; 'http://api.rottentomatoes.com/api/public/v1.0/movies.json',  
                                  'url'=&gt; Yii::app()-&gt;getBaseUrl(true).'/customer/SearchCustomer',  
                              'dataType' =&gt; 'jsonp',  
                              'data' =&gt; 'js: function (term,page) {  
                                          return {  
                                          term: term, // Add all the query string elements here seperated by ,  
                                          page_limit: 10,  
                                                 };  
                                                               }',        
                              'results' =&gt; 'js: function (data,page) {return {results: data};}',  
                              ),  
              'formatResult'    =&gt; 'js:function(data){  
                                  var markup = data.CustomerCode + " - ";  
                                  markup += data.Name;  
                                  return markup;  
                              }',
              'formatSelection' =&gt; 'js: function(data) {  
                                  return data.CustomerCode;  
                              }',  
  
      )));  
  </code></pre>
  
  <p>code snipped from controller action SearchCustomer</p>
  
  <pre><code>Yii::app()-&gt;clientScript-&gt;scriptMap['jquery.js'] = false;
  $this-&gt;renderJSON(Customer::model()-&gt;searchByCustomer($term));
  </code></pre>
  
  <p>renderJSON function from base controller class</p>
  
  <pre><code>   protected function renderJSON($data)
     {
         header('Content-type: application/json');
         echo $_GET['callback'] . "(";
         echo CJSON::encode($data);
         echo ")";
  
  
         foreach (Yii::app()-&gt;log-&gt;routes as $route) {
             if($route instanceof CWebLogRoute) {
                 $route-&gt;enabled = false; // disable any weblogroutes
             }
         }
         Yii::app()-&gt;end();
     }
  </code></pre>
  
  <p>Appreciate any help on this</p>