JQueryUI 1.10.0 Autocompleter renderItem problems

好久不见. 提交于 2019-12-04 02:03:46
Jonathan Pasquier

Instead of

$('selector').data('ui-autocomplete')._renderItem = function (ul, item) { };

you should use

$('selector').data('uiAutocomplete')._renderItem = function (ul, item) { };

I had the same problem. You should use $('selector').data('autocomplete')._renderItem = function (ul, item) {...};

Or just open console and type something like this: $('div').autocomplete().data()

There you'll see the method you have to use. In my case it's just 'autocomlete'

I found the solution!

Well, I'll share you my little experience. When I had this same issue, I listened to people talking about change "ui-autocomplete" to "uiAutocomplete" or just "autocomplete", but that's wrong.

The correct is really "ui-autocomplete", the solution of this issue isn't this. I solve my problem when I change my code from:

    .data('ui-autocomplete')._renderItem = function (ul, item)

to:

    .__renderItem = function(ul, item)

Try do that and tell me what's occur.

I had same issue with this line

.data("autocomplete")._renderItem = function (ul, item) {

I was able over come the error by adding any of these

1 - .data('ui-autocomplete')._renderItem = function (ul, item) { 
2 - .data('uiAutocomplete')._renderItem = function (ul, item) { 
3 - .__renderItem = function(ul, item) {
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!