Yii Framework Forum: jui Autocomplete and render Item - Yii Framework Forum

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

jui Autocomplete and render Item

#1 User is offline   Mario Merola 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 3
  • Joined: 11-April 16

Posted 20 March 2017 - 11:16 AM

Hi,
I want to use jui\AutoComplete but I don't see an example for custom renderItem.
I need to insert an image in render.

Here my code

<?=
AutoComplete::widget([
'clientOptions' => [
//'source' => Url::to(['/sfide/autocomplete']),
'source' => new JsExpression('function(request, response) {
$.ajax({
url: "' . Url::to(['/sfide/autocomplete'], true) . '",
dataType: "json",
data: {
term: request.term,
},
success: function (data) {
response(data);
}
})
}'),
'minLength' => '4',
'autoFill' => true,
'mode' => 'abort',
'class' => 'cercamicInput form-control',
'select' => new JsExpression('function( event, ui ) {$("#memberssearch-family_name_id").val(ui.item.id);}')
],
'options' => [
'class' => 'cercamicInput form-control',
'placeholder' => 'Cerca nuovi amici per nome',
],
]);
?>
0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users