patternfly-bootstrap-treeview
patternfly-bootstrap-treeview copied to clipboard
tree don't collapse
Hie,
I try using your bundle but I can't collapse the tree, even if I put levels:1 in the tree definition. No error fired. The tree is shown but all expanded. The same configuration works fine with jonmiles/bootstrap-treeview.
If I put some logic like nodeSlected it works.
I have jquery 2.2.4 from cdnjs and bootstrap from 3.3.6 from maxcdn.
Here is my tree definition :
$('#tree').treeview({ data: {{ tree|raw }}, showTags: true, // color: "#428bca", expandIcon: 'glyphicon glyphicon-chevron-right', collapseIcon: 'glyphicon glyphicon-chevron-down', levels: 1, });
Can you help me ?
i guess you must use patternfly‘s bootstrap-treeview.css patternfly-bootstrap-treeview.css v2.1.0
@Climberdav could you please post a working fiddle? And also verify if @3xxx's suggestion fixes the issue.
@3xxx's answer but on load the complete tree is expanded. i tried to add state to the json but it had no effect. Even calling $('#tree').treeview('collapseAll', { silent: false });
did not collapse it, you always have to click on every item to collapse it.
I switched my library from jonmiles/bootstrap-treeview
to this one, and added the css as @3xxx said and it works :+1: