https://github.com/tomi77/backbone-forms-chosen
Backbone-Forms chosen editor
https://github.com/tomi77/backbone-forms-chosen
backbone-forms chosen
Last synced: 2 months ago
JSON representation
Backbone-Forms chosen editor
- Host: GitHub
- URL: https://github.com/tomi77/backbone-forms-chosen
- Owner: tomi77
- License: mit
- Created: 2017-06-14T18:58:04.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2017-12-31T09:00:04.000Z (over 7 years ago)
- Last Synced: 2024-12-16T19:03:29.350Z (6 months ago)
- Topics: backbone-forms, chosen
- Language: CoffeeScript
- Homepage: https://tomi77.github.io/backbone-forms-chosen/
- Size: 25.4 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Backbone-Forms Chosen editor
[](https://codeclimate.com/github/tomi77/backbone-forms-chosen)
[](https://travis-ci.org/tomi77/backbone-forms-chosen)
[](https://coveralls.io/github/tomi77/backbone-forms-chosen?branch=master)
[](https://david-dm.org/tomi77/backbone-forms-chosen)
[](https://david-dm.org/tomi77/backbone-forms-chosen?type=dev)
[](https://david-dm.org/tomi77/backbone-forms-chosen?type=peer)
A [Backbone-Forms](https://github.com/powmedia/backbone-forms) editor that covers [Chosen](https://harvesthq.github.io/chosen/) functionality.
## Installation
Via ``bower``:
~~~bash
bower install backbone-forms-chosen
~~~Via ``npm``:
~~~bash
npm install backbone-forms-chosen
~~~## Usage
Just replace ``Select`` editor type with ``chosen``.
### Change placeholder
Add ``data-placeholder`` to ``editorAttrs``.
~~~js
schema: {
states: {
type: 'chosen',
title: 'States',
options: states,
editorAttrs: {
multiple: 'multiple',
'data-placeholder': 'Select countries...'
}
}
}
~~~### Add extra chosen editor options
Add ``editorOptions`` to schema.
~~~js
schema: {
states: {
type: 'chosen',
title: 'States',
options: states,
editorOptions: {
no_results_text: 'Oops, nothing found!'
}
}
}
~~~## Demo
https://tomi77.github.io/backbone-forms-chosen/