Note that there are some explanatory texts on larger screens.

plurals
  1. POjQuery UI Autocomplete stopped working
    primarykey
    data
    text
    <p>For some reason jQuery UI's autocomplete has stopped working for me. I get the same error as is described on <a href="http://forum.jquery.com/topic/jquery-ui-autocomplete-what-am-i-doing-wrong-here" rel="nofollow noreferrer">this webpage</a>.</p> <p>I've copied the content of the query from that webpage below, hoping that somebody here will be able to answer it.</p> <p>Thanks!</p> <p>I am using <code>Jquery UI Autocomplete</code> to get a list of names. But for some reason I am getting an error:</p> <p><img src="https://forum.jquery.com/viewImage.do?fileId=14737000000998621&amp;forumGroupId=14737000000003003" alt="alt text"></p> <blockquote> <pre><code>$('#repName').removeAttr('readonly').focus(function () { $(this).val(''); }).autocomplete({ source: function (request, response) { tagId = $('#TagId').val(); $.ajax({ url: '/Developement/GetRepName', type: 'POST', dataType: 'json', data: { searchText: request.term, maxResults: 10, tagId: tagId }, success: function (data) { response($.map(data, function (item) { return { label: item.Name, value: item.RepId, id: item.RepId } })) } }) }, select: function (event, ui) { commissionAllicationModifications(ui.item.id, 0, 'A'); } }); </code></pre> </blockquote> <p>I have no clue why this is happening. I am using Jquery UI 1.8.1.</p> <p>I would appreciate any kind of help on this.</p> <p>It is coming from the jQuery UI 1.8.1 file, specifically jQuery UI Autocomplete 1.8.1.</p> <blockquote> <pre><code> .menu({ focus: function (event, ui) { var item = ui.item.data("item.autocomplete"); if (false !== self._trigger("focus", null, { item: item })) { // use value to match what will end up in the input, if it was a key event if (/^key/.test(event.originalEvent.type)) { self.element.val(item.value); } } }, selected: function (event, ui) { var item = ui.item.data("item.autocomplete"); if (false !== self._trigger("select", event, { item: item })) { self.element.val(item.value); } self.close(event); // only trigger when focus was lost (click on menu) var previous = self.previous; if (self.element[0] !== doc.activeElement) { self.element.focus(); self.previous = previous; } self.selectedItem = item; }, * blur: function (event, ui) { * if (self.menu.element.is(":visible")) { * self.element.val(self.term); * } * } }) .zIndex(this.element.zIndex() + 1) // workaround for jQuery bug #5781 http://dev.jquery.com/ticket/5781 .css({ top: 0, left: 0 }) .hide() .data("menu"); </code></pre> </blockquote> <p>It is weird though because this works flawlessly in another project. What I noticed is when the code hits the [starred] section the self.menu section is undefined. Another thing of note was that it doesn't even send the request. I was thinking that it might be my focus function.</p> <blockquote> <pre><code>.focus(function () { $(this).val(''); </code></pre> </blockquote> <p>But it is not. Thank you for you help. </p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

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