$("#Auto").autocomplete({
minLength: 4,
type: 'GET',
source: function (request, response) {
var term = request.term;
if (term in cache) {
response(cache[term]);
return;
}
var url = '<%=Url.Action("AutoComplete", "Thing", new {area = "Admin"}) %>' + "?terms=" + request.term;
lastXhr = $.getJSON(url, request, function (data, status, xhr) {
cache[term] = data;
if (xhr === lastXhr) {
response(data);
}
});
}
})
.data("autocomplete")._renderItem = function (ul, item) {
return $("<li></li>")
.data("item.autocomplete", item)
.append("<a> Thingy1: " + item.Prop1 + " Thingy2: " + item.Prop2 + "<br>" + "</a>")
.appendTo(ul);
};
Предположим, что #Auto, Prop1 и Prop2 существуют, и существует контроллер под названием Thing.Это работает на другой странице, но по какой-то причине я получаю эту ошибку на странице:
$("#Auto").autocomplete({minLength: 4, type: "GET", source: function (request, response);var term = request.term;if (term in cache) {response(cache[term]);return;}var url = '<%=Url.Action("AutoComplete", "Thing", new {area = "Admin"}) %>' + "?terms=" + request.term;lastXhr = $.getJSON(url, request, function (data, status, xhr) {cache[term] = data;if (xhr === lastXhr) {response(data);}});}}).data("autocomplete") is undefined
У меня загружены следующие файлы:
jquery-ui-1.8.2.custom.min.js
jquery-1.4.2.min.js
jquery.autocomplete.pack.js
jquery.ajaxQueue.js
jquery.bgiframe.min.js
thickbox-compressed.js
jquery-ui-1.8.2.custom.css
jquery-require.1.1.packed.js
плюс некоторые другие пользовательские вещи.
Что-то мне не хватает, или у меня слишком много файлов в комплекте?