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

title and content in <ul> <li> #720

Open
Paul75 opened this issue Sep 24, 2023 · 1 comment
Open

title and content in <ul> <li> #720

Paul75 opened this issue Sep 24, 2023 · 1 comment

Comments

@Paul75
Copy link

Paul75 commented Sep 24, 2023

hello,

When I can add with ul mode (

  • ...) title and content ?

    Thanks

@dabeng
Copy link
Owner

dabeng commented Dec 22, 2023

Hi @Paul75 I create a demo on codepen.io for you -- https://codepen.io/dabeng-the-styleful/pen/YzgzEGp . The core snippets are shown below:

    var nodeTemplate = function(data) {
      return `
        <div class="title">${data.name}</div>
        <div class="content">
          ${data.members.map(member => `
            <li>${member.name}</li>
          `).join('')}
        </div>
      `;
    };

    var oc = $('#chart-container').orgchart({
      'data' : ds,
      'nodeTemplate': nodeTemplate
    });

@dabeng dabeng closed this as completed Dec 22, 2023
@dabeng dabeng reopened this Dec 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants