Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

customize the name property of the data #18

Open
foxmask opened this issue Oct 21, 2020 · 1 comment
Open

customize the name property of the data #18

foxmask opened this issue Oct 21, 2020 · 1 comment
Assignees
Labels
enhancement New feature or request
Milestone

Comments

@foxmask
Copy link

foxmask commented Oct 21, 2020

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

@chniter chniter self-assigned this May 25, 2021
@chniter chniter added the enhancement New feature or request label May 25, 2021
@chniter chniter added this to the v1.3.0 milestone May 25, 2021
@chniter
Copy link
Owner

chniter commented May 25, 2021

Hi,

Stay tuned, will be done next release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants