【问题标题】:Bootstrap Typeahead And TagsInputBootstrap 预输入和标签输入
【发布时间】:2014-07-16 00:23:11
【问题描述】:

我正在开发 Bootstrap Typeahead。我正在使用引导程序 3.1,并下载此脚本。 http://twitter.github.io/typeahead.js/

我也在使用http://timschlechter.github.io/bootstrap-tagsinput/examples/bootstrap3/

<input id="Subject" type="text" class="form-control" placeholder="Subject">

我的脚本是;

$('#Subject').tagsinput({
typeahead: {
    source: ['Amsterdam', 'Washington', 'Sydney', 'Beijing', 'Cairo']
}
});

tagsinput 插件正在运行,但是,typeahead 不起作用。我怎么解决这个问题? 谢谢。

【问题讨论】:

    标签: twitter-bootstrap


    【解决方案1】:

    试试这个:

    $('#Subject').tagsinput({
        //options for tagsinput here
    }).typeahead({
        source: ['Amsterdam', 'Washington', 'Sydney', 'Beijing', 'Cairo']
    });
    

    typeahead()tagsinput() 方法不一定相关,因此您需要在选择器上分别调用它们(通过 method chaining)。

    【讨论】:

    • TypeError: $(...).tagsinput(...).typeahead is not a function
    • @YannBertrand:这里也一样。有什么建议吗?
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2018-05-25
    • 2015-05-14
    • 2018-08-25
    • 2012-10-26
    • 2020-06-15
    • 1970-01-01
    • 2012-05-18
    相关资源
    最近更新 更多