|
From: Scott A. L. <sc...@sc...> - 2000-11-05 20:16:05
|
The original idea behind the two array was to have a flexible way to
reference DynLayers and to provide a proper toString method so you can do
away with the eval(this.obj + "=this") trick.
all:
- allows you to check for the number of DynLayers with the .length property
- best when used with for (var i=0;i<all.length;i++) type loop
- useful if you ever need an ordinal reference
alID:
- allows an instant check by ID (no loop needed)
- best when used with for (var i in all) type loop
- easy array element deletion: delete allID[obj.id]
- used to return a consistent string reference:
DynAPI.getDocument(id).allID[id]
I agree it can be a pain to manage the two arrays.
-----Original Message-----
From: Robert Rainwater <rra...@ya...>
To: DynAPI Dev <dyn...@li...>
Date: Saturday, November 04, 2000 10:57 PM
Subject: [Dynapi-Dev] Updated dynlayer and dyndocument
>
>I've updated the dynlayer and dyndocument so that the recreateall will
>actually work. The biggest pain was adding children of children to
>the all array in the addChild method. So I added a method addChildID
>that should fix the problem. When a dynlayer thats knows its dyndoc
>or a dyndocument itself calls addchild, then that child and all of its
>children are added to the .all and .allID arrays.
>
>I've attached my dynlayer and dyndocument files. Please let me know
>of any bugs/improvements because it hasn't been fully tested yet.
>
>Also, the method calls like oncreate that are hard coded into the
>dynlayer need to be removed. Like:
>if (this.onCreate) { this.onCreate() } file://<-
>
>The only problem is that they are used in some of the widgets. So if
>we are going to remove these, everyone should make sure their widgets
>use the eventlisteners instead.
>
>Also, could someone tell me the purpose of the .all array? I know we
>need the allID array, but the all array I just don't understand.
>
>
>\\Robert
>
>--
|