-
Notifications
You must be signed in to change notification settings - Fork 3
jQuery datatreeview collapsed
Maikel Bos edited this page Dec 31, 2020
·
1 revision
When creating a datatreeview, sometimes you want the treeview nodes to be collapsed instead of expanded at initizalization. To achieve this, set the data-collapsed
attribute to 'true'.
<div id="example-treeview" data-collapsed="true">
</div>
<script type="text/javascript">
$('#example-treeview').datatreeview({
data: [
{
value: '1',
text: 'Foo',
children: [
{ value: '4', text: 'Quux' },
{ value: '5', text: 'Quuux' }
]
},
{ value: '2', text: 'Bar' },
{ value: '3', text: 'Baz' }
]
});
</script>