WebFX WebBoard
Message Thread:
View All Messages
Back to WebFX
 Xtree, frames and targets, TimT, March 3, 2004
     Re:Xtree, frames and targets , Guillermo, March 4, 2004
     Re:Xtree, frames and targets, Emil A Eklund, March 3, 2004
         Re:Xtree, frames and targets, Erik Arvidsson, March 4, 2004
         Re:Xtree, frames and targets, TimT, March 3, 2004
             Re:Xtree, frames and targets, Emil A Eklund, March 4, 2004

Subject: Re:Xtree, frames and targets From: Emil A Eklund Date: March 4, 2004
Actually you could replace the constructor with the following to add support for setting the target.

function WebFXTreeItem(sText, sAction, sTarget, eParent, sIcon, sOpenIcon) {
this.base = WebFXTreeAbstractNode;
this.base(sText, sAction);
/* Defaults to close */
if (webFXTreeConfig.usePersistence) {
this.open = (webFXTreeHandler.cookies.getCookie(this.id.substr(18,this.id.length - 18)) == '1')?true:false;
} else { this.open = false; }
this.target = sTarget;
if (sIcon) { this.icon = sIcon; }
if (sOpenIcon) { this.openIcon = sOpenIcon; }
if (eParent) { eParent.add(this); }
}

That way you could do:

b.add(new WebFXTreeItem('Heroes','../clients/heroes.htm', 'C'));

/Emil
--------------------------------------------------------

I suspected as much. That's going to be a lot of work and variables! But at least it will do it and since everything else about the script is awesome, I have no choice but to use it.
Thanks for the help.
From: Emil A Eklund
Sent: March 3, 2004
Subject: Re:Xtree, frames and targets

The target property is not inherited, thus must be added to each node.

Instead of
a.add(new WebFXTreeItem('Heroes','../clients/heroes.htm'));

you would have to use
var b = new WebFXTreeItem('Heroes','../clients/heroes.htm');
b.target = 'C';
a.add(b);

A bit cumbersome perhaps.

/Emil
-------------------------------------------------------



How can I use the target property to make links for items added under a folder to open in my main content frame ("C"). I can make it work for folder level links but not items added underneath. Please the sample code below to illustrate...
if (document.getElementById) {
var tree = new WebFXTree('Home', '../people.htm');
tree.target = "C";
tree.setBehavior('classic');
tree.icon = 'images/PC.gif';
tree.openIcon = 'images/PC.gif';
var a = new WebFXTreeItem('Clients', '../clients/');
a.target = "C";
tree.add(a);
a.add(new WebFXTreeItem('Heroes', '../clients/heroes.htm'));
document.write(tree);
}

Any help is greatly appreciated!






Reply
Name: 
Email: 
Subject: 

Enter your reply to this message below. HTML tags are not supported but words that start with http://, ftp:// or mailto: are converted to links.


View All Messages
Back to WebFX