sselvamani22 / jOrgChart

Here more functionality of jquery orgchart with json support
http://selvamani-subramani.github.io/jOrgChart
30 stars 16 forks source link

Can't get it work with a simple list. #9

Closed p4535992 closed 8 years ago

p4535992 commented 8 years ago

Hi, try to use your plugin with a simple list, but i have some problem to make it work with a simple html list, i put the code of the body below:

<body>                
    <ul id="tree-data">
        <li id="unic1" class="unic1 root">      
            <span class='label_node'>Articolazione Uffici</span>                              
            <ul> 
                <li id="unic2" class="child unic2"><span class='label_node'>Ufficio 1</span></li>
                <li id="unic3" class="child unic3"><span class='label_node'>Padre 1 - Ufficio</span>       
                    <ul> 
                        <li id="unic4" class="child unic4"><span class='label_node'>Figlio 1 - Padre 1 - Ufficio</span></li>
                        <li id="unic5" class="child unic5"><span class='label_node'>Figlio 2 - Padre 1 - Ufficio</span></li>
                    </ul> 
                </li>
                <li id="unic6" class="child unic6"> Padre 2 - Ufficio 
                    <ul> 
                        <li id="unic7" class="child unic7"><span class='label_node'>Figlio 1 - Padre 2 - Ufficio</span></li>
                        <li id="unic8" class="child unic8"><span class='label_node'>Figlio 2 - Padre 2 - Ufficio</span></li>
                    </ul>       
                </li>
            </ul>    
        </li>
    </ul>
    <div id="tree-view" class="orgChart"></div>     
    <!-- powered with boostrap -->
    <script>
        jQuery(document).ready(function ($) {               
            init_tree();
        });

        function init_tree() {
            var opts = {
                chartElement: "#tree-view", //your tree container
                dragAndDrop: false
            };
            jQuery("#tree-view").html(""); //clean your container
            jQuery("#tree-data").jOrgChart(opts); //creates the jOrgChart
        }
       </script>                           
</body>

But without any exception i have the <div class="jOrgChart"></div> empty and i don't know why. My Objective is use your plugin with html list wihtout the json integration. Ty in advance.

selvamani-subramani commented 8 years ago

Hi @p4535992 ,

Thanks for point out the issue. Now master branch has been updated with fixed lot of issues with the issue which you mentioned above. Hope now it will work fine.

p4535992 commented 8 years ago

Ty very much, now work like a charm. Ty again for this plugin.

selvamani-subramani commented 8 years ago

You are welcome!!