title: Jquery UI Autocomplete not working
body: <p>Im using Jquery widget Autocomplete.My data source  is a server-side script which returns JSON data.</p>
  
  <pre><code>$(function() {      
      $( "#supcode" ).autocomplete({
          source:"index.php/inventory/supcode",
          minLength: 1                    
      });
  });
  </code></pre>
  
  <p>Im using MVC architecture (Codeigniter) and using following method in controller to return the JSON data,</p>
  
  <pre><code>function supcode()
  {     
      $dataarray="";
      $data=$this-&gt;Inventorymodel-&gt;supcode();
      echo json_encode($data);
  }
  </code></pre>
  
  <p>And I am fetching the data in model using following function,</p>
  
  <pre><code>function supcode(){
  $finresult="";
  $this-&gt;db-&gt;select('name');
  $query = $this-&gt;db-&gt;get('supplier');
  $result=$query-&gt;result_array();
  
  foreach($result as $row){
      $finresult[]=array(
          'name' =&gt; $row['name']
      );
  }
  return $finresult;
  }
  </code></pre>
  
  <p>When I type a letter in the textbox filtering is not working and all the items are listed.What have I done wrong here? Can anyone help me? Thanks in advance....</p>