title: Jquery UI Autocomplete from remote source categorized
body: <p>There are nice documentation on the jquery ui site on showing auto-complete options categorized <a href="http://jqueryui.com/demos/autocomplete/#categories" rel="nofollow">http://jqueryui.com/demos/autocomplete/#categories</a></p>
  
  <p>And there is also an example about showing remote suggestions.
  <a href="http://jqueryui.com/demos/autocomplete/#remote" rel="nofollow">http://jqueryui.com/demos/autocomplete/#remote</a>  </p>
  
  <p>But what I want is to load auto-complete options categorized from a remote source. How can I do that? Can any one point me to example or some code snippet? I have been trying this for long. If my search.php can generate that source needed for the categorized suggestion. How do i implement it in the front end? </p>
  
  <p>I'm able to generate return this from my php.(Thats how its needed for categorized autocomplete)</p>
  
  <pre><code>                    [
     { label: "anders", category: "" },
     { label: "andreas", category: "" },
     { label: "antal", category: "" },
     { label: "annhhx10", category: "Products" },
     { label: "annk K12", category: "Products" },
     { label: "annttop C13", category: "Products" },
     { label: "anders andersson", category: "People" },
     { label: "andreas andersson", category: "People" },
     { label: "andreas johnson", category: "People" }
     ];
  </code></pre>
  
  <p>But how do i implement in the front-end? 
  This is the code available for remotesource in the site.
  How do i specify that the php will give results for categorized suggestion?</p>
  
  <pre><code> &lt;script&gt;
   $(function() {
    function log( message ) {
     $( "&lt;div/&gt;" ).text( message ).prependTo( "#log" );
     $( "#log" ).attr( "scrollTop", 0 );
    }
  
    $( "#birds" ).autocomplete({
     source: "search.php",
     minLength: 2,
     select: function( event, ui ) {
      log( ui.item ?
       "Selected: " + ui.item.value + " aka " + ui.item.id :
       "Nothing selected, input was " + this.value );
     }
    });
   });
   &lt;/script&gt;
  </code></pre>