ventnor-selectize
v2.0.0
Published
A ventnor selectize view
Downloads
4
Readme
ventnor-selectize
Installation
npm install --save ventnor-selectize
Usage
var Selectize = require('ventnor-selectize')
, serviceLocator = {}
, selectedOptions = [ 1, 2, 3 ]
, service = { find: function (searchTerm, query, sort, options, cb) {} }
, view = new Selectize(serviceLocator, selectedOptions, { service: service })
view.render().$el.appendTo('body')
// Emitted when the value changes
view.on('change', function (value) {
alert(value)
})
var view = new Selectize(serviceLocator, selectedOptions, options)
serviceLocator
- a service locator instanceselectedOptions
- the options to be selected (as an array)
Options must include:
service
a service with afind()
function that has a signature offunction (searchTerm, query, sort, options, cb)
Options can include:
logger
- defaults toconsole
Credits
License
ISC