ventnor-selectize

A ventnor selectize view

Usage no npm install needed!

<script type="module">
  import ventnorSelectize from 'https://cdn.skypack.dev/ventnor-selectize';
</script>

README

ventnor-selectize

A ventnor selectize view

build status dependency status

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 instance
  • selectedOptions - the options to be selected (as an array)

Options must include:

  • service a service with a find() function that has a signature of function (searchTerm, query, sort, options, cb)

Options can include:

  • logger - defaults to console

Credits

Dom Harrington

License

ISC