@adactive/bootstrap-tagsinput 中文文档教程
Bootstrap Tags Input
Bootstrap Tags Input 是一个 jQuery 插件,提供用于管理标签的 Twitter Bootstrap 用户界面。
当前稳定版本:v0.8.0
Usage
示例可以在此处找到。
Features
- Objects as tags
- True multi value
- Typeahead
- Designed for Bootstrap 2.3.2 and 3
Objects as tags
不只是支持使用字符串! 这意味着您可以使用不同的值 对于标签的标签和值。 每个标签还包含对该对象的引用 它是由它创建的,所以通过调用 tagsinput('items')
一个 返回原始项目的数组。
True multi value support
其他实现只是将值连接到逗号分隔的字符串。 这导致 val()
只返回这个字符串,当 提交表单时,请求中只会发送一个大的串联值。
Bootstrap Tags Input 提供真正的多值支持。 只需使用一个 <select multiple />
作为您的输入元素,并且 val()
将返回一个标签值数组。 提交时 形式,值的数组将与请求一起发送。
Typeahead support
与 Twitter Bootstraps 的 2.3.2 typeahead 集成,或在使用 Bootstrap 3 时使用自定义 typeahead。
Development
安装依赖项:
npm install grunt install
测试:
grunt test
构建:
grunt build
当前库版本:
- Bootstrap: 3.3.5
- jQuery: 2.1.4
- Typeahead: 0.11.1
用于测试的库位于 /lib 目录中。
History
- 0.8.0
- Add possibility skip "change" event after "add", "remove", "removeAll"
- Please add version to header of non-minified version.
- 0.7.1
- allowDuplicates not working
- tag text appears when typeahead input looses focus
- Remove duplicate method
removeAll
in manual - 0.7.0
- .tt-menu etc. styles should be included in bootstrap-tagsinput.css by default
- Comma character carried over to new tag input when used as separator
- Emails in multi select are being duplicated
- The 'itemAdded' Event run on Load the Page!
- 0.6.1
- Source maps fix
- 0.6.0
- Allow form submissions when pressing enter if field is empty. Controlled by option
- Ability to set different or multiple delimiters
- No longer triggering itemRemoved when the field is already empty
- 0.5
- Added an optional 3rd parameter to the "add" and "remove" methods
- 0.4
- Fix typeahead when using Bootstrap 3
- 0.3.13
- #5: Trigger events on original input/select
- Loads of fixes merged with help of @janvt, @rlidwka and @kuraga: thanks for helping me out!
- 0.3.9
- #48: Type ahead stops when entering second character
- 0.3.8
- #43: Add support for placeholder
- #46: ie 8 compatibility, replace indexOf method
- 0.3.7
- #39: flash when duplicate is entered
- 0.3.6
- #34: Error in ReloadPage
- 0.3.5
- #10: confirmKeys option
- 0.3.4
- #24: Add bsTagsInput angular directive & example for bootstrap3 with typeahea…
- #28: Limit number of tags, enable/disable input
- #33: Avoid conflict with other selects when checking for value presence
License
此项目已根据 MIT 获得许可。
Bootstrap Tags Input
Bootstrap Tags Input is a jQuery plugin providing a Twitter Bootstrap user interface for managing tags.
Current stable version: v0.8.0
Usage
Examples can be found here.
Features
- Objects as tags
- True multi value
- Typeahead
- Designed for Bootstrap 2.3.2 and 3
Objects as tags
Not just support for using strings! This means you can use different values for a tag's label and value. Each tag also holds a reference to the object by which it was created, so by calling tagsinput('items')
an array of the original items is returned.
True multi value support
Other implementations just concatenate the values to a comma separated string. This results in val()
returning just this string, and when submitting the form, only one big, concatenated value is sent in the request.
Bootstrap Tags Input provides true multivalue support. Just use a <select multiple />
as your input element, and val()
will return an array of the tag values. When submitting the form, an array of values will be sent with the request.
Typeahead support
Integrates with Twitter Bootstraps' 2.3.2 typeahead, or use custom typeahead when using Bootstrap 3.
Development
Install dependencies:
npm install grunt install
Test:
grunt test
Build:
grunt build
Current Library Versions:
- Bootstrap: 3.3.5
- jQuery: 2.1.4
- Typeahead: 0.11.1
Libraries for testing go in the /lib directory.
History
- 0.8.0
- Add possibility skip "change" event after "add", "remove", "removeAll"
- Please add version to header of non-minified version.
- 0.7.1
- allowDuplicates not working
- tag text appears when typeahead input looses focus
- Remove duplicate method
removeAll
in manual - 0.7.0
- .tt-menu etc. styles should be included in bootstrap-tagsinput.css by default
- Comma character carried over to new tag input when used as separator
- Emails in multi select are being duplicated
- The 'itemAdded' Event run on Load the Page!
- 0.6.1
- Source maps fix
- 0.6.0
- Allow form submissions when pressing enter if field is empty. Controlled by option
- Ability to set different or multiple delimiters
- No longer triggering itemRemoved when the field is already empty
- 0.5
- Added an optional 3rd parameter to the "add" and "remove" methods
- 0.4
- Fix typeahead when using Bootstrap 3
- 0.3.13
- #5: Trigger events on original input/select
- Loads of fixes merged with help of @janvt, @rlidwka and @kuraga: thanks for helping me out!
- 0.3.9
- #48: Type ahead stops when entering second character
- 0.3.8
- #43: Add support for placeholder
- #46: ie 8 compatibility, replace indexOf method
- 0.3.7
- #39: flash when duplicate is entered
- 0.3.6
- #34: Error in ReloadPage
- 0.3.5
- #10: confirmKeys option
- 0.3.4
- #24: Add bsTagsInput angular directive & example for bootstrap3 with typeahea…
- #28: Limit number of tags, enable/disable input
- #33: Avoid conflict with other selects when checking for value presence
License
This project is licensed under MIT.