0

如何使用自定义函数扩展自动完成选择方法

$( ".selector" ).autocomplete({
   select: function(event, ui) { 
    ui.item.option.selected = true;
    self._trigger( "selected", event, {
        item: ui.item.option
    });
}
});

我改为

$( ".selector" ).autocomplete({
   select: customSelect
});


function customSelect(event, ui) { 
    ui.item.option.selected = true;
    self._trigger( "selected", event, {
        item: ui.item.option
    });
}

但是这里self._trigger会出错self._trigger is not a function。如何从 select 传递实例或在扩展 select 时如何更正?

4

0 回答 0