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,它非常有效
| 归档时间: |
|
| 查看次数: |
8137 次 |
| 最近记录: |