bstreeview
bstreeview copied to clipboard
customize the name property of the data
Hi,
in your example you give us a var
containing
var tree = [
{
text: "Node 1",
icon: "fa fa-folder",
nodes: [
{
text: "Sub Node 1",
icon: "fa fa-folder",
nodes: [
{
id: "sub-node-1",
text: "Sub Child Node 1",
icon: "fa fa-folder",
class: "nav-level-3",
href: "https://google.com"
},
{
text: "Sub Child Node 2",
icon: "fa fa-folder"
}
]
},
{
text: "Sub Node 2",
icon: "fa fa-folder"
}
]
},
What if my array is named children
and my text
is named title
?
I thought I could try
// Example: initializing the bstreeview
$('#tree').bstreeview({
data: data,
expandIcon: 'fa fa-angle-down fa-fw',
collapseIcon: 'fa fa-angle-right fa-fw',
indent: 1.25,
parentsMarginLeft: '1.25rem',
openNodeLinkOnNewTab: true
nodes: 'children',
text: 'title',
});
but that does not do the trick.
Is it possible ?
regards
Hi,
Stay tuned, will be done next release.