Tree not appearing correctly

I have the following code to initialise a tree which is called on body load of html document.

    function setuptreePriceBands()
    {
        trPriceBands = new dhtmlXTreeObject("treePriceBands","100%","100%",0);
        trPriceBands.setSkin("dhx_skyblue");
        trPriceBands.setImagePath("/javascripts/dhtmlx/dhtmlxTree/codebase/imgs");
        trPriceBands.enableTreeImages("true");
        trPriceBands.enableTreeLines("true");
        
        trPriceBands.insertNewChild(0,1,"Zones",0,0,0,0);
        trPriceBands.insertNewChild(1,"12","Western Europe",0,0,0,0)
        trPriceBands.insertNewChild(1,"13","Eastern Europe",0,0,0,0)
        
        trPriceBands.insertNewChild(0,"2","Countries",0,0,0,0);
        
    }

However this produces the following when rendered:

Zones
Western Europe
Eastern Europe
Countries

Each item is below the previous one even though Western Europe and Eastern Europe should be indented under Zones and there are NO IMAGES showing anywhere. As it is rendering it appears correctly for a second with indenting and place holders for the images but they all disappear.

I am using dhtmlxSuite_v26_PRO_100722. I have included the correct css file and also the correct images path.

I am surely doing something simple wrong but can’t see it. Thanks for your help.

I don’t know whether this is relevant but I can’t see any of the ‘trees’ in the samples included with the software either.

Hi,

Each item is below the previous one even though Western Europe and Eastern Europe should be indented under Zones

we have not reproduced the problem. What browser do you use? Please provide the complete demo.

there are NO IMAGES showing anywhere.

Make sure that image path is correct

I can’t upload any files. Your system rejects ALL FILES with or without any extensions. It just says ‘The extension is not allowed. The upload was rejected because the uploaded file was identified as a possible attack vector’. This has been the case in the past when I wanted to upload a file. Please can you let me know how to upload a file in the forum.

I’ve included the complete file below. I have tried this on Firefox/Ubuntu, Firefox/Windows XP and IE8/Windows XP. All give exactly the same result.

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
    "http://www.w3.org/TR/html4/loose.dtd">
<html>
	<head>
        <script src="/gttjavascripts/commonjsfuncs.js" type="text/javascript" charset="utf-8"></script>
        <script src="/javascripts/dhtmlx/dhtmlxTree/codebase/dhtmlxcommon.js" type="text/javascript" charset="utf-8"></script>
        <script src="/javascripts/dhtmlx/dhtmlxTree/codebase/dhtmlxtree.js" type="text/javascript" charset="utf-8"></script>

       
        <link rel="stylesheet" href="/javascripts/dhtmlx/dhtmlxTree/codebase/dhtmlxtree.css" type="text/css" media="screen" charset="utf-8">

<script type="text/javascript" charset="utf-8">
//Global Variables
	var trPriceBands;

	
	function setuptreePriceBands()
	{
		trPriceBands = new dhtmlXTreeObject("treePriceBands","100%","100%",0);
		trPriceBands.setSkin("dhx_skyblue");
		trPriceBands.setImagePath("/javascripts/dhtmlx/dhtmlxTree/codebase/imgs");
		trPriceBands.enableTreeImages("true");
		trPriceBands.enableTreeLines("true");
		
		trPriceBands.insertNewChild(0,1,"Zones",0,0,0,0);
		trPriceBands.insertNewChild(1,"12","Western Europe",0,0,0,0)
		trPriceBands.insertNewChild(1,"13","Eastern Europe",0,0,0,0)
		
		trPriceBands.insertNewChild(0,"2","Countries",0,0,0,0);
		
	}
	
</script>

	</head>

	<body onLoad="setuptreePriceBands()">
		<style>
			html, body 
			{
				width: 100%;
				height: 100%;
				margin: 0px;
				overflow: hidden;
			}
		</style>

		<div id="treePriceBands" style="height:100%; width:100%"></div>
        
		<script type="text/javascript" charset="utf-8">
		</script>
	</body>
</html>

Please help as I got a project because the client saw the ‘Tree’ functionality and liked it.

I’ve attached the working demo. Please check it. Probably the path to images was incorrect.
tree.zip (34 KB)