Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>Since I just joined and can't comment on <em>drcforbin</em>'s post above, I guess I have to add my own answer.</p> <p><em>drcforbin</em> is correct, although it is really a different problem than the one that the OP had. Anyone coming to this thread now is probably facing this issue due to the new version of jQuery UI just released. Certain naming conventions relating to autocomplete were deprecated in jQuery UI in v1.9 and have been completely removed in v1.10 (see <a href="http://jqueryui.com/upgrade-guide/1.10/#autocomplete" rel="noreferrer">http://jqueryui.com/upgrade-guide/1.10/#autocomplete</a>).</p> <p>What is confusing, however, is that they only mention the transition from the <strong>item.autocomplete</strong> data tag to <strong>ui-autocomplete-item</strong>, but the <strong>autocomplete</strong> data tag has also been renamed to <strong>ui-autocomplete</strong>. And it's even more confusing because the demos are still using the old syntax (and thus are broken).</p> <p>The following is what needs to change in the _renderItem function for jQuery UI 1.10.0 in the Custom Data demo here: <a href="http://jqueryui.com/autocomplete/#custom-data" rel="noreferrer">http://jqueryui.com/autocomplete/#custom-data</a></p> <p>Original code:</p> <pre><code>.data( "autocomplete" )._renderItem = function( ul, item ) { return $( "&lt;li&gt;" ) .data( "item.autocomplete", item ) .append( "&lt;a&gt;" + item.label + "&lt;br&gt;" + item.desc + "&lt;/a&gt;" ) .appendTo( ul ); }; </code></pre> <p>Fixed code:</p> <pre><code>.data( "ui-autocomplete" )._renderItem = function( ul, item ) { return $( "&lt;li&gt;" ) .data( "ui-autocomplete-item", item ) .append( "&lt;a&gt;" + item.label + "&lt;br&gt;" + item.desc + "&lt;/a&gt;" ) .appendTo( ul ); }; </code></pre> <p>Note the changes for both <strong>autocomplete</strong> and <strong>item.autocomplete</strong>. I've verified that this works in my own projects.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload