dabeng / OrgChart

It's a simple and direct organization chart plugin. Anytime you want a tree-like chart, you can turn to OrgChart.
MIT License
2.85k stars 767 forks source link

Render [object Object] inside nodeContent #204

Open feldmarv opened 7 years ago

feldmarv commented 7 years ago

Hey there Is it possible to render javascript objects inside nodeContent. At the moment I am just able to expose the javascript object.

bildschirmfoto 2017-04-05 um 15 08 06

        $('#chart-container').orgchart({
            'data' : department_chart_config.datasource,
            'depth': 10,
            'nodeContent': 'users',
            'draggable': true,
            'dropCriteria': function($draggedNode, $dragZone, $dropZone) {
                if($draggedNode.find('.content').text().indexOf('manager') > -1 && $dropZone.find('.content').text().indexOf('engineer') > -1) {
                    return false;
                }
                return true;
            }
        });
feldmarv commented 7 years ago

Any idea?

robnelson commented 7 years ago

Hey, I see you are trying to add users for a department, I am trying to do the same, did you get anywhere with this?