Search and Top Navigation
#8584 closed bug (notabug)
Opened September 18, 2012 02:23PM UTC
Closed October 05, 2012 12:36AM UTC
auto complete render item prolem if apply to multi element
| Reported by: | deng.hui5 | Owned by: | |
|---|---|---|---|
| Priority: | minor | Milestone: | 1.9.0 |
| Component: | ui.autocomplete | Version: | 1.9.0-rc.1 |
| Keywords: | Cc: | ||
| Blocked by: | Blocking: |
Description
the following sample code doesn't render as expected
$( "#A, #B, #C, #D" ).autocomplete({
minLength: 0,
source: ...,
focus: ...,
select: ...
}).data( "autocomplete" )._renderItem = function( ul, item ) {
return $( "<li></li>" )
.data( "item.autocomplete", item )
.append( "<a>" + item.code + ": " + item.description + "</a>" )
.appendTo( ul );
};
sorry, this way works
$( "#A, #B, #C, #D" ).autocomplete({ minLength: 0, source: ..., focus: ..., select: ... }).each(function(){ data( "autocomplete" )._renderItem = function( ul, item ) { return $( "<li></li>" ) .data( "item.autocomplete", item ) .append( "<a>" + item.code + ": " + item.description + "</a>" ) .appendTo( ul ); };});then display