我从jQuery UI站点复制了一些代码并将其附加到我自己的代码中:
$('.field_values') // class that all input fields are a member of in my html
// here I am skipping .autocomplete, which works
// next comes the copied code
.data( 'ui-autocomplete' )._renderItem = function( ul, item ) {
return $( '<li>' )
.append( '<a>' + item.label + '<br>' + item.value + '</a>' )
.appendTo( ul );
}
;
Run Code Online (Sandbox Code Playgroud)
我在这个_renderItem函数上找不到任何文档.另一个stackoverflow问题/答案表明问题可能是一个类而不是一个id.但我必须上课,因为有很多领域.
我怎样才能让这个与我的班级一起工作?
jquery-ui ×1