我有这个代码:
$.widget("custom.gamecomplete", $.ui.autocomplete, {
_renderMenu: function (ul, items) {
var self = this;
$.each(items, function (index, item) {
ul.append('<div id="searchItem_' + item.id + '" class="ico ico-' + item.platform + '"></div>');
self._renderItem(ul, item);
});
$(ul).children("li").each(function (index, li) {
$(li).prepend($(ul).children("div.ico:first"));
});
}
});
// override close method - see link below for details
(function(){
var originalCloseMethod = $input.data("gamecomplete").close();
$input.data("gamecomplete").close = function(event) {
if (!selected){
//close requested by someone else, let it pass
originalCloseMethod.apply( this, arguments );
}
selected = false;
};
})();
我收到这个错误
$input.data(...) is undefined
我认为是因为 Jquery Ui Autocomplete 的更新......我该如何解决这个问题?
谢谢