【问题标题】:Show All Dropdown options when typeahead input field is empty and select multiple tags using typeahead当 typeahead 输入字段为空并使用 typeahead 选择多个标签时显示所有下拉选项
【发布时间】:2018-09-28 10:01:37
【问题描述】:

我正在使用引导标签输入插件和预先输入。

我希望他们两个一起工作,即如果输入字段为空,则显示整个下拉列表,如果使用预先输入,它应该选择多个选项,如标签输入。

我怎样才能做到这一点?

请帮帮我。

【问题讨论】:

  • 请提供您的代码示例
  • plnkr.co/edit/7yDk829M3wavyn1oJoAE?p=preview 是显示我需要的链接。但我无法使用此代码来做到这一点。
  • 一个有点老的问题,但我发现在您的示例中,您可以在 typeahead 对象中传递选项 showHintOnFocus: true 。因此,您不必为其添加按钮。

标签: twitter-bootstrap typeahead.js bootstrap-tags-input


【解决方案1】:

这应该可行。

$('#device').tagsinput({ 
   typeahead: {
      source:  ['Alabama', 'Alaska', 'Arizona', 'Arkansas', 'Wyoming'],
     autoSelect: false,
     items : 1000,
     minLength : 0
   }
});     

主要区别是在标签输入选项中使用“typeahead”而不是“typeaheadjs”。 这些人解释得更好。 https://bootstrap-tagsinput.github.io/bootstrap-tagsinput/examples/

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2014-05-06
    • 1970-01-01
    • 2015-06-29
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2013-09-16
    • 1970-01-01
    相关资源
    最近更新 更多