#8996 closed bug (notabug)
Autocomplete with custom _renderItem() is broken in 1.10.0
Reported by: | arthas | Owned by: | |
---|---|---|---|
Priority: | minor | Milestone: | none |
Component: | ui.autocomplete | Version: | 1.10.0 |
Keywords: | Cc: | ||
Blocked by: | Blocking: |
Description
Trying to override _renderItem() using:
$("#field").data( "autocomplete" )._renderItem = function( ul, item ) { ... }
is broken in 1.10.0. Just take a look at the online example, which is broken as well:
http://jqueryui.com/autocomplete/#custom-data
It throws a JS error (Cannot set property '_renderItem' of undefined on Chrome), and then "works" by only displaying the basic data but not the custom data and display.
Change History (7)
comment:2 Changed 10 years ago by
Done, and it works.
However, something is to be fixed: either the library or the example itself so it uses uiAutocomplete.
Thanks!!!
comment:3 Changed 10 years ago by
You're welcome.
I think that jquery guys will provide corrections about that.
Have a nice day.
comment:4 Changed 10 years ago by
Resolution: | → notabug |
---|---|
Status: | new → closed |
Thanks. The bug on the demo is being tracked here - https://github.com/jquery/jqueryui.com/issues/32.
comment:5 follow-up: 6 Changed 10 years ago by
Shouldn't this be "ui-autocomplete" and not "uiAutocomplete"?
Also, the migration guide for v1.10 should mention this change in addition to the already mentioned change from "item.autocomplete" to "ui-autocomplete-item".
comment:6 follow-up: 7 Changed 10 years ago by
Replying to dlong500:
Shouldn't this be "ui-autocomplete" and not "uiAutocomplete"?
Yes, but they are the same thing in the eyes of .data()
.
Also, the migration guide for v1.10 should mention this change in addition to the already mentioned change from "item.autocomplete" to "ui-autocomplete-item".
It does: http://jqueryui.com/upgrade-guide/1.10/#removed-data-fallbacks-for-widget-names
comment:7 Changed 10 years ago by
Replying to scott.gonzalez:
Replying to dlong500:
Also, the migration guide for v1.10 should mention this change in addition to the already mentioned change from "item.autocomplete" to "ui-autocomplete-item".
It does: http://jqueryui.com/upgrade-guide/1.10/#removed-data-fallbacks-for-widget-names
I see, but it's not immediately clear for end users since people using the UI components aren't necessarily thinking about widgets and such. It would be quite a bit clearer to include a mention of ui-autocomplete in the same note about ui-autocomplete-item. But thanks for the clarification anyway.
use "uiAutocomplete" instead of "autocomplete"