here is the code I used in a project... hope it helps! :-)
function ExpendAll() {
var i:Number;
var j:Number;
j = this.length;
for(i = 0; i < j; i++) {
var oNode:XMLNode = this.getTreeNodeAt(i);
var ValeurCourrante:Number = 0;
if(oNode != undefined) {
if(this.getIsBranch(oNode)) {
this.ExpandNode(oNode);
i=0;
j = this.length;
}
}
}
}
//Ouvre un noeud incluant les enfants si présents
function ExpandNode (oNode:XMLNode) : Void {
this._parent._parent.ActionLongeurNoeud(oNode, true);
if(this.getIsBranch(oNode)) {
this.setIsOpen(oNode, true);
if(oNode.childNodes.length > 0) {
var j:Number;
for(j = 0; j < oNode.childNodes.length; j++) {
var oSubNode:XMLNode = oNode.childNodes[j];
this.ExpandNode(oSubNode);
}
}
}
}
//Ferme tout l'arbre incluant les enfants si présents
function CloseAll() {
var i:Number;
var j:Number;
j = this.length;
for(i = 0; i < j; i++) {
var oNode:XMLNode = this.getTreeNodeAt(i);
if(oNode != undefined && this.getIsBranch(oNode)) {
this.CloseNode(oNode);
i=0;
j = this.length;
}
}
}
//Ferme le noeud courrant incluant les enfants si présents
function CloseNode(oNode:XMLNode, Mode:Number, Racine:Boolean) : Void {
if(this.getIsBranch(oNode) and this.getIsOpen(oNode)) {
if(oNode != this.getTreeNodeAt(0)) {
this.setIsOpen(oNode, false);
}
if(oNode.childNodes.length > 0) {
var j:Number;
for(j = 0; j < oNode.childNodes.length; j++) {
var oSubNode:XMLNode = oNode.childNodes[j];
this.CloseNode(oSubNode,0,false);
}
}
}
}
Martin Schafer wrote:
Daniel,
I am looking for something that would allow every branch to be recursively
set to Open. Wouldn't the code below only open the children of root?
Martin :)
On 10/27/05 2:06 PM, "Daniel Cascais" <[EMAIL PROTECTED]> wrote:
--
===============================================================
Éric Thibault
Programmeur analyste
Réseau de valorisation de l'enseignement
Université Laval, pavillon Félix-Antoine Savard
Québec, Canada
Tel.: 656-2131 poste 18015
Courriel : [EMAIL PROTECTED]
===============================================================
Avis relatif à la confidentialité / Notice of Confidentiality / Advertencia de
confidencialidad <http://www.rec.ulaval.ca/lce/securite/confidentialite.htm>
_______________________________________________
Flashcoders mailing list
[email protected]
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders