提前引导-更改源 [英] bootstrap typeahead - changing source

查看:72
本文介绍了提前引导-更改源的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在寻找一种更改source打字的方法.

I looking for a way to change source for typeahed.

例如,假设我有以下两个列表,并且要视情况而定,我希望使用其他来源进行预输入.

For instance, assume I have the following 2 lists, and depend on the case, I'd like to have the typeahead workingin with a different source.

var list1 = ["this", "is", "first", "list"],
    list2 = ["second", "list", "comes", "here"];

$("selector").typeahead({source: list1})

然后,当我这样做

$("selector").typeahead({source: list2})

并开始在输入框中输入内容,第一个列表将出现在新列表的下方.

and start typing into the input box, the first list appears underneath the new one.

我尝试做

$("selector")
    .removeData()
    .typeahead({source: list2})

但是,它没有任何作用.

Yet, it has no effect.

推荐答案

您必须按照指示

这篇关于提前引导-更改源的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆