[Project_owners] Easiest way to save/restore <tree/> state?

Eric H. Jung grimholtz at yahoo.com
Wed Feb 8 12:39:12 EST 2006


After not getting a reply on this list, I decided to post the question
here: http://forums.mozillazine.org/viewtopic.php?t=378182

I also got no reply there.

One last plea for help...anyone?

--- "Eric H. Jung" <grimholtz at yahoo.com> wrote:

> Hi,
> 
> I have a number of template-driven, RDF-based <tree/> elements. They
> do
> not specify 'dont-build-content'. I haven't found a way to
> "automatically" save and restore the open/closed state of tree
> containers, so unless someone can suggest one to me, I'm going to
> code
> it manually.
> 
> My question is: what's the best way to maintain the list of
> open/closed
> containers in an RDF file given that containers can be deleted and
> moved? I was thinking of storing the subject of each open container
> in
> a click callback:
> 
> tree.addEventListener("click", clickListener, true);
> function clickListener(event) {
>   if (event.detail == 1) {
>     var row = {}, col = {}, childElt = {};
>     this.treeBoxObject
>       .getCellAt(event.clientX, event.clientY, row, col, childElt);
>     if (childElt.value == "twisty" && row.value > -1) {
>       // TODO: save open/close state
>     }
> }
> 
> Any other ideas?
> 
> Thank you,
> Eric Jung
> _______________________________________________
> Project_owners mailing list
> Project_owners at mozdev.org
> http://mozdev.org/mailman/listinfo/project_owners
> 



More information about the Project_owners mailing list