A tree for a set of bootstrap selectpickers
- jquery
- bootstrap
- bootstrap-select
$ npm install
- see example/index.html
- See a codepen example
-
Put a
divwith a uniqueidin aform -
Call
$( "#...id..." ).selectpickerTree( {data: [...], metadata: {...}}); -
data:
arrayofobjectwith a property for the name and property for the items
-
metadata:
objectwith properties:- name
string: name of the data to show in the selectpicker options: defaults toname - label
string: form label for the select picker - children
string: name of the children for the next selectpickers data, defaults toitems - child
object: metadata of the child - options
object: selectpicker options, defaults to{ liveSearch: true, title: 'Choose one...'}. title is always set if none is given
- name
