title: jQuery Autocomplete with _renderItem and categories
body: <p>As a newb to jQuery I'm wondering if it's possible to have both jQuery _renderItem (for custom list item HTML/CSS) <em>and</em> the categories working together in harmony.</p>
  
  <p>I've got my _renderItem working great but I have no idea how to incorporate categories into the mix.</p>
  
  <p>My code so far:</p>
  
  <pre><code>$(document).ready(function () {
  $(':input[data-autocomplete]').each(function () {
      $(':input[data-autocomplete]').autocomplete({
          source: $(this).attr("data-autocomplete")
      }).data("autocomplete")._renderItem = function (ul, item) {
          var MyHtml = "&lt;a&gt;" + "&lt;div class='ac' &gt;" +                        
                       "&lt;div class='ac_img_wrap' &gt;" +
                       '&lt;img src="../../uploads/' + item.imageUrl + '.jpg"' + 'width="40" height="40" /&gt;' +
                       "&lt;/div&gt;" +
                       "&lt;div class='ac_mid' &gt;" +
                       "&lt;div class='ac_name' &gt;" + item.value + "&lt;/div&gt;" +
                       "&lt;div class='ac_info' &gt;" + item.info + "&lt;/div&gt;" +
                       "&lt;/div&gt;" +
                       "&lt;/div&gt;" + "&lt;/a&gt;";
          return $("&lt;li&gt;&lt;/li&gt;").data("item.autocomplete", item).append(MyHtml).appendTo(ul);
      };
  });
  });
  </code></pre>
  
  <p>The jQuery documentation for the autocomplete gives the following code example:</p>
  
  <pre><code>$.widget("custom.catcomplete", $.ui.autocomplete, {
  _renderMenu: function (ul, items) {
      var self = this,
              currentCategory = "";
      $.each(items, function (index, item) {
          if (item.category != currentCategory) {
              ul.append("&lt;li class='ui-autocomplete-category'&gt;" + item.category + "&lt;/li&gt;");
              currentCategory = item.category;
          }
          self._renderItem(ul, item);
      });
  }
  });
  </code></pre>
  
  <p>I'd like to get my custom HTML _renderItem and categories working together, can anyone help me to merge these two together or point me in the right direction?</p>