title: Lazy initialization of jquery UI autocomplete
body: <p>I'd like to lazy initialize the source options of a jQueryUI autocomplete. I'm aware of the possibility to pass a function to the source option, but I want to delay the initialization until the user really starts using the autocomplete.</p>
  
  <p>I tried waiting for the search event and then set the source option, but this has no effect.</p>
  
  <pre><code>var availableTags = [
      "ActionScript",
      "AppleScript",
      "Scheme"
      ];
  $("#searchFirstTransactionStateInfo_searchPartnerId").autocomplete({
      source : [],
      minLength: 0,
      search: function( event, ui ) {
          $(event.target).source = availableTags;
      }
  });
  </code></pre>
  
  <p>How can I delay setting the source option until the user starts using the UI element?</p>
  
  <p>Note: I used a fixed array for simplicity. Finally I want to call an AJAX function.</p>