Skip to main content

Search and Top Navigation

#8996 closed bug (notabug)

Opened January 22, 2013 11:20AM UTC

Closed January 22, 2013 01:38PM UTC

Last modified January 26, 2013 05:47PM UTC

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.

Attachments (0)
Change History (7)

Changed January 22, 2013 12:12PM UTC by gbonetti comment:1

_comment0: use "uiAutocomplete" instead of "autocomplete" \ 1358856810565520

Please, use "uiAutocomplete" instead of "autocomplete"

Changed January 22, 2013 01:22PM UTC by arthas comment:2

Done, and it works.

However, something is to be fixed: either the library or the example itself so it uses uiAutocomplete.

Thanks!!!

Changed January 22, 2013 01:31PM UTC by gbonetti comment:3

You're welcome.

I think that jquery guys will provide corrections about that.

Have a nice day.

Changed January 22, 2013 01:38PM UTC by tj.vantoll comment:4

resolution: → notabug
status: newclosed

Thanks. The bug on the demo is being tracked here - https://github.com/jquery/jqueryui.com/issues/32.

Changed January 24, 2013 05:55AM UTC by dlong500 comment:5

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".

Changed January 24, 2013 12:47PM UTC by scottgonzalez comment:6

Replying to [comment:5 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

Changed January 26, 2013 05:47PM UTC by dlong500 comment:7

Replying to [comment:6 scott.gonzalez]:

Replying to [comment:5 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.