bstreeview icon indicating copy to clipboard operation
bstreeview copied to clipboard

customize the name property of the data

Open foxmask opened this issue 4 years ago • 1 comments

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

foxmask avatar Oct 21 '20 16:10 foxmask

Hi,

Stay tuned, will be done next release.

chniter avatar May 25 '21 16:05 chniter