更新时间:2023-09-18 18:07:52
JqueryUI网站上有一些有关如何自定义结果布局的文档: http://jqueryui.com/demos/autocomplete/#custom-data .
There is some documentation on JqueryUI website on how to customize the result layout: http://jqueryui.com/demos/autocomplete/#custom-data.
一些例子:
$( "#SearchInput" ).autocomplete({ .... }).data( "autocomplete" )._renderItem = function( ul, item ) {
return $( "<li></li>" )
.data( "item.autocomplete", item )
.append( "<a>" + "<img src='" + item.imgsrc + "' />" + item.id+ " - " + item.label+ "</a>" )
.appendTo( ul );
};