open popover from typeahead list

2020-05-06 09:09发布

I have a typeahead textfield from bootstrap. What I want to do is: When you click on an item from typeahead list they open a popover and it will be placed on the textfield. Is this possible?

I already have an item that have onclick="alert(000)" rel="popover". If I click on it the alertbox will open, so it can do something. But the popover doesnt work. Is it even possible to open a popover from typeahead?

1条回答
我想做一个坏孩纸
2楼-- · 2020-05-06 09:47

Although the updater option is not documented, you can use it to do something when an item is selected : Demo (jsfiddle)

$('#myTypeahead').typeahead({
    source: source,
    updater: function(item) {
        // Do something here, `item` is the selected item
        return item;
    }
});
查看更多
登录 后发表回答