twitter-bootstrap-3 – bootstrap-tagsinput with typeahead,bo
在我的一个项目中,我曾经在bootstrap-2.3.2中使用bootstrap-tags输入
http://timschlechter.github.io/bootstrap-tagsinput.最近我更新了两个(bootstrap为3,tagsinput为0.3.9).在更新期间,我发现外部的tagsinput取决于
http://twitter.github.io/typeahead.js/.
我尝试根据文档使用bs-tagsinput和typeahead.那有点颠簸.例如,bootstrap-tagsinput docs下的typeahead代码示例: $('input').tagsinput('input').typeahead({ prefetch: 'citynames.json' }).bind('typeahead:selected',$.proxy(function (obj,datum) { this.tagsinput('add',datum.value); this.tagsinput('input').typeahead('setQuery',''); },$('input'))); </script> typeahead [‘setQuery’]不再存在于typeahead ver 1.0中(它在ver 0.9中).我对数据集使用typeahead.source方法.来自’source’的typeahead没有在0.9中实现,因此降级似乎不是一个选项.我不确定是否用typeahead [‘val’]替换它(尽管两者都没有解决我看到的问题). 问题是,把所有东西放在一起后,我遇到了错误的行为(如预期的那样).具体来说,我在插入标签(输入一个单词并按下回车)后面临一个问题: 如果我使用箭头选择其中一个tt-advice,就不会发生这个问题 有谁知道什么是获取tagsinput-w / typeahead功能的最佳方法? 解决方法
twitter.github.io/typeahead.js与bootstrap 3不兼容.
您可以使用与twitter bootstrap 3兼容的Typeahead https://github.com/bassjobsen/Bootstrap-3-Typeahead 实际上开发人员将bootstrap 2代码迁移到bootstrap 3这里的细节是http://bassjobsen.weblogs.fm/migrate-your-templates-from-twitter-bootstrap-2-x-to-twitter-bootstrap-3/ (编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |