{"id":1856,"date":"2022-08-30T15:20:01","date_gmt":"2022-08-30T15:20:01","guid":{"rendered":"https:\/\/unknownerror.org\/index.php\/2013\/12\/02\/jquery-autocomplete-failing-the-focus-collection-of-common-programming-errors\/"},"modified":"2022-08-30T15:20:01","modified_gmt":"2022-08-30T15:20:01","slug":"jquery-autocomplete-failing-the-focus-collection-of-common-programming-errors","status":"publish","type":"post","link":"https:\/\/unknownerror.org\/index.php\/2022\/08\/30\/jquery-autocomplete-failing-the-focus-collection-of-common-programming-errors\/","title":{"rendered":"Jquery Autocomplete failing the focus-Collection of common programming errors"},"content":{"rendered":"<p>I am working with autocomplete, I want to add an header to the list and it is getting me complicated, I am having some problems with this: This is my code:<\/p>\n<pre><code> var autocompleteCounselor = function () {\n\n              $(this.el).find('.alternateCounselorAutocomplete').autocomplete({\n                  minLength: 0,\n                  source: this.counselorValidDelegates,\n                  focus: function (event, ui) {\n                    console.log(ui);\n                      $(\".alternateCounselorAutocomplete\").val(ui.item.NAME());\n                      return false;\n                  },\n                  select: function (event, ui) {\n                      onAutocompleteAlternateCounselorSelected.apply(_self, [event, ui, _self.counselorFullValidDelegates]);\n                  }\n                }).data(\"ui-autocomplete\")._renderMenu = function(ul, items){\n                  var self = this;\n\n                  ul.append(\"<\/code><\/pre>\n<li><code>Name\"+ \"Title<\/code><\/li>\n<p id=\"rop\"><small>Originally posted 2013-12-02 21:01:43. <\/small><\/p>","protected":false},"excerpt":{"rendered":"<p>I am working with autocomplete, I want to add an header to the list and it is getting me complicated, I am having some problems with this: This is my code: var autocompleteCounselor = function () { $(this.el).find(&#8216;.alternateCounselorAutocomplete&#8217;).autocomplete({ minLength: 0, source: this.counselorValidDelegates, focus: function (event, ui) { console.log(ui); $(&#8220;.alternateCounselorAutocomplete&#8221;).val(ui.item.NAME()); return false; }, select: function (event, [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-1856","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/1856","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/comments?post=1856"}],"version-history":[{"count":0,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/1856\/revisions"}],"wp:attachment":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/media?parent=1856"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/categories?post=1856"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/tags?post=1856"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}