Twitter Typeahead更新程序

Tim*_*imH 3 ajax jquery twitter-bootstrap typeahead.js bloodhound

谁能看到我在这里做错了什么?我花了很多年时间查看各种类型的前瞻代码.从我可以选择的Json调用返回值,但是我需要设置Id隐藏字段.我已尝试过更新程序功能(日志,警报等)中的所有排序但是压缩.我相信它不会触发.

    var teamNames = new Bloodhound({
    datumTokenizer: Bloodhound.tokenizers.obj.whitespace('Text'),
    queryTokenizer: Bloodhound.tokenizers.whitespace,
    remote: 'List'
});

teamNames.initialize();

$('#remote #FullName').typeahead(null, {
    name: 'team-names',
    displayKey: 'Text',
    source: teamNames.ttAdapter(),
    updater: function(item){$('#Id').val(map[item].Value)}
})
Run Code Online (Sandbox Code Playgroud)

非常感谢任何观察.如果你认为你有答案,请设置答案,这样我才能承认 - 干杯.

更新 - 我怀疑我使用了一些过时或不兼容的代码.我现在用过

 $('#FullName').bind('typeahead:selected', function (obj, datum, name) {}
Run Code Online (Sandbox Code Playgroud)

在GitHub上找到了这个,感谢andy3rdworld,它非常有效

Ale*_*Zak 6

我有同样的问题...我认为我们依赖于使用旧版本的typehead的示例... /:

Typehead 现在使用事件 ......这是最后的例子 ......