> this.elm holds the reference to the actual element. Naturally. It can be loaded at different times though, and that what makes the difference. If you want a fast startup, (like I do when loading a large treeview) it seems to make sense to assign this.elm when it's needed, and not at startup. (as Dynlayers that are not altered after creation never use this.elm as far as I can see, and the parentElement.children[] lookup seems to take a little time at during creation) So basically, all (this.elm!=null) checks could be replaced with a function that returns true if this.elm is already assigned, and assigns it if the element exists, but this.elm hasn't been set yet.
This should work, as the ID is known all along, so the elm can be found using document.all[this.id] or document.getElementById(this.id). Don't worry, I'm not going to change all the code around, I just wondered if the moment this.elm is assigned had been thought over yet, as this does get start-up times down significantly. (although setting this.elm later also creates a little lag, the user probably would probably not notice, as it's just one layer being set then) >you should just write your > own div strings in the parent. That's the idea behind the Litelayer, just a simple DIV which we keep a handle on, with no inheritance from DynObject, no eventlisteners, and only setBgColor, setHTML and setCssClass as functions. This makes a nice lightweight container for display purposes (borders, backgrounds, treenodes etc). They can be set as children of Dynlayers, although they can't have children of their own. Anyway, thanks for the feedback. Cheers, Richard. www.richardinfo.com ----- Original Message ----- From: "Robert Rainwater" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Saturday, October 27, 2001 3:51 PM Subject: Re[2]: [Dynapi-Dev] Rendering Dynlayers, 25%+ speed increase. > this.elm holds the reference to the actual element. So without it, a > dynlayer is useless. if thats the case, you should just write your > own div strings in the parent. _______________________________________________ Dynapi-Dev mailing list [EMAIL PROTECTED] http://www.mail-archive.com/dynapi-dev@lists.sourceforge.net/