Coder Social home page Coder Social logo

Comments (8)

dabeng avatar dabeng commented on July 25, 2024

Hi, fvlima, you tried the example -- ondemand-loading-data and got this bug ?

from orgchart.

fvlima avatar fvlima commented on July 25, 2024

I'm using the ajax datasource example. And I guess that is the point because theren't no more parents for a determined node, and the arrow is showed to perform a click to load more data. See my code:

$('#id).orgchart({ 'data': '../url/' + id, 'nodeRelationship': 'level', 'nodeTitle': 'relationship', 'nodeChildren': 'parents', 'nodeContent': 'identification', 'parentNodeSymbol': '', 'nodeID': 'id', 'depth': 4, 'createNode': function ($node, data) { if (data['img'] != undefined) { var miniature = $('<i>', { 'class': 'fa fa-info-circle second-menu-icon', click: function () { $(this).siblings('.second-menu').toggle(); } }); var img = '<div class="second-menu">' + '<img class="avatar" src="/media/' + data['img'] + '"></div>'; $node.append(miniature).append(img); } } });

I know that the error refers to opts.ajaxURL, because it doesn't defined, but I chose to not load data on demand, only a initial ajax request that brings me all nodes showing only the first four nodes.

from orgchart.

dabeng avatar dabeng commented on July 25, 2024

Hi, fvlima. Does your returned json datasource contain corrent property "level", it's value should be "110" or "111". The three numbers indicate that whether the node has parent node, sibling node or child node.

from orgchart.

dabeng avatar dabeng commented on July 25, 2024

You know, wrong indicator numbers will result in wrong arrows, and wrong arrows will mislead users to load non-existing nodes.

from orgchart.

fvlima avatar fvlima commented on July 25, 2024

Hi. I need to ask apologies for my mistake. I thought that if a node had no children, then the orgchart would ignore automatically these empty children nodes. Maybe it can be developed to prevent situations like mine, because were not defined urls to load data on demand.

from orgchart.

dabeng avatar dabeng commented on July 25, 2024

Hi, fvlima, I got your point, I admit that in most cases, the indicator number is unnecessary except ondemand loading scenario, because in this scenario, orgchart needs some signal to load unknown nodes and in other scenarios, orgchart loads all nodes all at once, orgchart should be capable of generate the right collapsing/expanding arrows according the fixed hierarchy. I'll refine the code as soon as possible.

from orgchart.

dabeng avatar dabeng commented on July 25, 2024

The idea -- I thought that if a node had no children, then the orgchart would ignore automatically these empty children nodes, has come true in version 0.9.9.7 of orgchart.

from orgchart.

sirshikher avatar sirshikher commented on July 25, 2024

Hi, fvlima, you tried the example -- ondemand-loading-data and got this bug ?

yes

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.