Giter Site home page Giter Site logo

Add to Structure about orgchart HOT 12 CLOSED

dabeng avatar dabeng commented on July 24, 2024
Add to Structure

from orgchart.

Comments (12)

dabeng avatar dabeng commented on July 24, 2024

Hi. It's not a big deal. You can use the following code snippets to implement this feature:

    $('#chart-container').orgchart({
      'data' : datascource,
      'createNode': function($node, data) {
        if (data.name === 'Keyser Soze') {
          $node.append(<div class="assistant">Kobayashi</div>);
         }
      }
    });

from orgchart.

wispoz avatar wispoz commented on July 24, 2024

Ye, but how it will work with rendered structure :
we have space between node1 and node2 we must have space to add assistant

from orgchart.

dabeng avatar dabeng commented on July 24, 2024

It doesn't matter. You just need to append some styles of node to enlarge the distance between normal nodes in horizontally and then you will got the large enough space to place the assistant node. For example:

.orgchart .node {
  margin: 0 30px;
}

On the other hand, you also need to append relative position settings for assistant node.

from orgchart.

dabeng avatar dabeng commented on July 24, 2024

Another proposal, I think it will be better if we remain the distance between normal nodes and add show/hide effects for assistant nodes. If I were you, I would add icon standing for assistant role into the content section of normal node and toggle the assistant node by clicking the icon. By doing so, we can save lots of space to show more nodes and hierarchies.

from orgchart.

HariBabuThubati avatar HariBabuThubati commented on July 24, 2024

drag and drop in IE is not working.can you do needful.

from orgchart.

dabeng avatar dabeng commented on July 24, 2024

Hi @HariBabuThubati , which version of your IE browser ?

from orgchart.

HariBabuThubati avatar HariBabuThubati commented on July 24, 2024

Hi dabeng, IE11 i am using.

from orgchart.

dabeng avatar dabeng commented on July 24, 2024

in fact, I have tested drag&drop feature on IE 11, it works well. So I wanna know did you change any core code snippets of drag&drop example?

from orgchart.

HariBabuThubati avatar HariBabuThubati commented on July 24, 2024

Hi dabeng, i just download and ran the example for drag drop.

from orgchart.

fahad4fbi avatar fahad4fbi commented on July 24, 2024

Hi @HariBabuThubati ,
This line in lib. is responsible for drag and drop problem in IE.

event.originalEvent.dataTransfer.setData('text/html', 'hack for firefox'); // line 674

Kindly wrap this line inside a check, so it only executes in firefox. You will be good to go.

from orgchart.

dabeng avatar dabeng commented on July 24, 2024

Thank you guys for your deep insight. This bug has been fixed in version 1.1.4.

from orgchart.

naylee avatar naylee commented on July 24, 2024

Hi @dabeng, i want to have chart similar as what @wispoz did. I already tried your suggestions too.
Here is my orgchart:
image

But, since Employee 2 only need 1 assistant-node, so I use margin-right only and here is the result:

image

The problem is, I want the 'top-line' in the middle of 'Employee 2' node not in between 'Employee 2' node and asisstant-node.

Is it possible to do that? I already tried but still can't get what I want.

from orgchart.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.