A tree for a set of bootstrap selectpickers
- jquery
- bootstrap
- bootstrap-select
$ npm install
- see example/index.html
- See a codepen example
-
Put a
div
with a uniqueid
in aform
-
Call
$( "#...id..." ).selectpickerTree( {data: [...], metadata: {...}});
-
data:
array
ofobject
with a property for the name and property for the items
-
metadata:
object
with 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