• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

dtree

 
Ranch Hand
Posts: 126
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

I am working on dtree. But I want to implement frames in dtree. In the sence when I click on the right pane(ie.dtree node) which is first frame, it has to show the specific page in left pane (I mean the second frame).

Any help is appreciated

Regards
Infyniti.
 
author
Posts: 15385
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You need to set the target for your links with the name of your frame.

Eric
 
Anant Rao
Ranch Hand
Posts: 126
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks Eric...but here is my code for dtree which is in the first frame ...where can I set target.


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

<html>

<head>
<title>Destroydrop » Javascripts » Tree</title>

<link rel="StyleSheet" href="dtree.css" type="text/css" />
<script type="text/javascript" src="dtree.js"></script>

</head>

<body>

<h1><a href="/">Destroydrop</a> » <a href="/javascripts/">Javascripts</a> » <a href="/javascripts/tree/">Tree</a></h1>

<h2>Example</h2>

<div class="dtree">

<p><a href="javascript: d.openAll();">open all</a> | <a href="javascript: d.closeAll();">close all</a></p>

<script type="text/javascript">

d = new dTree('d');

d.add(0,-1,'My example tree');
d.add(1,0,'Node 1','HelpFiles/first.htm');
d.add(2,0,'Node 2','example01.html');
d.add(3,1,'Node 1.1','example01.html');
d.add(4,0,'Node 3','example01.html');
d.add(5,3,'Node 1.1.1','example01.html');
d.add(6,5,'Node 1.1.1.1','example01.html');
d.add(7,0,'Node 4','example01.html');
d.add(8,1,'Node 1.2','example01.html');
d.add(9,0,'My Pictures','example01.html','Pictures I\'ve taken over the years','','','img/imgfolder.gif');
d.add(10,9,'The trip to Iceland','example01.html','Pictures of Gullfoss and Geysir');
d.add(11,9,'Mom\'s birthday','example01.html');
d.add(12,0,'Recycle Bin','example01.html','','','img/trash.gif');

document.write(d);


</script>

</div>

<p><a href="mailto:drop@destroydrop.com">©2002-2003 Geir Landrö</a></p>

</body>

</html>


Regards
Infyniti.
 
Eric Pascarello
author
Posts: 15385
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
From their API:
mytree.add(1, 0, 'My node', 'node.html', 'node title', 'mainframe', 'img/musicfolder.gif');

Eric
 
Anant Rao
Ranch Hand
Posts: 126
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks a lot Eric.
 
Anant Rao
Ranch Hand
Posts: 126
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Eric/Others
I have one more doubt....
If I want number of nodes in ( i mean length of dtree)

I have tried the below code but its giving n as 1.

n= dTree.length;

Actually I am writing help file using dtree. The user passing the url as query string it has to go and open the index page(dtree page) with nodes open to that url in dtree.

Any help is appreciated

Regards
Infyniti.
 
Anant Rao
Ranch Hand
Posts: 126
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi ,

Atlast I found the length of the dTree


dTree.prototype.length=function(urls){
for (var n=0; n<this.aNodes.length; n++) {
if (this.aNodes[n].url==urls){
var frame= this.aNodes[n].target;
return n;
}

and I am using frames to display the contents for the node selected.
i.e I have divided page into 2 frames one contains dtree and other the contains of the node when selected. I am selecting the required node when page loads...below is my script

<script type="text/javascript">



d = new dTree('d');

d.add(0,-1,'My example tree');
d.add(1,0,'Node 1','HelpFiles/first.htm');
d.add(2,0,'Node 2','example01.html');
d.add(3,1,'Node 1.1','example01.html');
d.add(4,0,'Node 3','HelpFiles/first.htm','Node 3','showframe');
d.add(5,3,'Node 1.1.1','HelpFiles/second.htm','Node 1.1.1','showframe');
d.add(6,5,'Node 1.1.1.1','example01.html');
d.add(7,0,'Node 4','HelpFiles/second.htm','Node 1.1.1','showframe');
d.add(8,1,'Node 1.2','example01.html');
d.add(9,0,'My Pictures','example01.html','Pictures I\'ve taken over the years','','','img/imgfolder.gif');
d.add(10,9,'The trip to Iceland','example01.html','Pictures of Gullfoss and Geysir');
d.add(11,9,'Mom\'s birthday','example01.html');
d.add(12,0,'Recycle Bin','example01.html','','','img/trash.gif');
document.write(d);




var n=d.length('HelpFiles/second.htm');

d.openTo(n);
d.s(n);


and when i run the program the node is getting selected but I am struck in displaying the contents of that selected node. (no clicking only selected node when the page is loaded).

Any help will appreciated.

thanks
Infyniti
[ September 15, 2005: Message edited by: infyniti molugu ]
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic