0.4.6 • Published 9 years ago

treeview-react-bootstrap v0.4.6

Weekly downloads
275
License
-
Repository
github
Last release
9 years ago

treeview-react-bootstrap

Nice, easy to use component to displaying tree structures, made with React and Twitter Bootstrap Based on jonmiles/react-bootstrap-treeview, but provides a set of additional useful features

Try it :

You can see an example here

Installation

Usage

Import
es2015 style import
Render
in *.jsx :
in *.js :
Options
ParamDescriptionDefault
dataObject No default, expects dataThis is the core data to be displayed by the tree viewundefined
selectableBoolean flagAllow to select nodes by clicking on themtrue
allowNewBoolean flagAllow to add new nodes using add buttonfalse
removableBoolean flagAllow to remove existing nodes using remove buttonfalse
onNodeAddedCallbackFunction that is called after node has been addedundefined
onNodeRemovedCallbackFunction that is called after node has been removedundefined
onDoubleClickCallbackFunction that is called after node has been removedundefined

This treeview component also supports all options defined for base component.

Data structure

"data" property must be provided for treeview to work. It should be an array of objects(nodes).

Node object structure.
Node options

The following properties are defined to allow node level overrides, such as node specific icons, colours and tags.

ParamDescriptionDefault
textString Mandatory The text value displayed for a given tree node, typically to the right of the nodes icon.undefined
iconString The icon-class set to icon on given node, typically displayed to the left of the text."glyphicon glyphicon-stop"
colorString The foreground color used on a given node, overrides global color option.#428bca
backColorString The background color used on a given node, overrides global color option.undefined
hrefString Used in conjunction with global enableLinks option to specify anchor tag URL on a given node.undefined
stateObjectDescribes a node's initial state.node: props.node, expanded: true
state.expandedBooleanWhether or not a node is expanded i.e. open. Takes precedence over global option levels.true
state.selectedBooleanWhether or not a node is selected.false
tagsStringUsed in conjunction with global showTags option to add additional information to the right of each node; using Bootstrap Badgesundefined
Example
0.4.6

9 years ago

0.4.5

9 years ago

0.4.4

9 years ago

0.4.3

9 years ago

0.4.2

9 years ago

0.4.1

9 years ago

0.4.0

9 years ago

0.3.0

9 years ago

0.2.4

10 years ago

0.2.3

10 years ago

0.2.2

10 years ago

0.2.1

10 years ago

0.1.0

10 years ago

0.0.0

10 years ago