This repository has been archived by the owner on Feb 5, 2025. It is now read-only.
v2.0.0
Bootstrap Treeview V2 Release
Treeview Node Properties / API changes
- tooltip: option for tree nodes to add tooltip text on mouse hover
- image: ability to override node icons with images
- lazyLoad - adds option for lazyLoading a tree node in conjunction with lazyLoad function
- checkable: whether a node is checkable in the tree, used in conjunction with showCheckbox
- dataAttr: lists of per-node HTML
data
attributes to append - class: list of custom css classes to append, separated by space
- id: custom HTML id attributes
- hideCheckbox: used to hide the checkbox of a given node when
showCheckbox
is set totrue
Treeview Options / API Changes
- dataUrl: jQuery Ajax settings object, accepts a set of key/value pairs that configure an Ajax request
- changedNodeColor: sets the text color for a node with a changed checkbox
- checkboxFirst: swaps the node icon with the checkbox, used in conjunction with showCheckbox
- loadingIcon: sets the icon used on loadLazy node before its content gets loaded
- hierarchalCheck: whether or not to enable hierarchal checking/unchecking of checkboxes
- propagateCheckEvent: whether or not to propagate nodeChecked and nodeUnchecked events to the parent/child nodes, used in conjunction with hierarchalCheck
- highlightChanges: highlights the nodes with changed checkbox state, used in conjunction with showCheckbox
- lazyLoad: this function is called when a lazily-loadable node is being expanded for the first time
- partiallyCheckedIcon: sets the icon for a partially checked checkbox
- preventUnselect: whether or not a node can be unselected without another node first being selected
- showImage: whether or not to display a nodes image instead of the icon
- wrapNodeText: whether or not to surround the text of the node with a span tag
Methods / API Changes
Note: all methods that accept an argument nodes
will now accept either a single node or an Array of nodes
- addNode: add nodes to the tree
- addNodeAfter: add nodes to the tree after given node
- addNodeBefore: add nodes to the tree before given node
- findNodes: returns an array of matching node objects
- getChecked: returns an array of checked nodes
- getUnchecked: returns an array of unchecked nodes
- removeNode: removes given nodes from the tree
- revealNode: reveals given tree nodes, expanding the tree from node to root
- uncheckCheckboxChanges: marks all checkboxes as unchanged, removing highlighted class
- unselectNode: unselected given tree nodes
Lifecycle Events / additional events added
loading (event)
- The tree has initiated data loading.loadingFailed (event, error)
- The tree failed to load data (ajax error)initialized (event, nodes)
- The tree has initialized itself and data ready for rendering.nodeRendered (event, node)
- A new node is renderedrendered (event, nodes)
- The tree is rendereddestroyed (event)
The tree is being destroyed