title: Yii2: Jui Auto Complete Widget how to?
body: <p>I am trying to use yii2 Jui autocomplete widget.</p>
  
  <p>I have this code which is showing the auto-complete date correctly, but I am not able to save the data.</p>
  
  <pre><code>$data=ArrayHelper::map(State::find()-&gt;all(), 'id', 'state_name' );
  $data=array_merge($data);
  </code></pre>
  
  <p>And then</p>
  
  <pre><code>echo 'State' .'&lt;br&gt;';
    echo AutoComplete::widget([
      'model'=&gt;$model,
      'attribute' =&gt; 'state_id',     
      'clientOptions' =&gt; [
          'source' =&gt; $data,        
      ],
  ]);
  </code></pre>
  
  <p>Any solution will be greatly appreciated.
  Thanks.</p>