> The problem I'm having is not only related to widgets,
> but o layers on a whole. It's just taking far to much
> time to create a few layers. As I've stated earlier I
> tried to create 40 basic layers (without any
> events)and the time taken was just not acceptable for
> web apps
There's a few ways to optimize creation time. DynAPI2 as it is right now inserts
newly created layers after the page loads.
If you do loop with DynAPI.document.addChild( new DynLayer() ), it will be very very
slow. But you if nest all those layers in some other layer:
p = new DynLayer();
for (..) p.addChild( new DynLayer() );
DynAPI.document.addChild(p);
You should see some performance gain because it pastes in all the children layers
while it creates the "p" layer. I named this feature pre-creation, but it's kind of
like serialization for DynLayers. It definately improved performance in Netscape by
an order of magnitude, not so much for IE though.
All the necessary code is there to extend the serializaiton so that you would be able
to add layers before onLoad. Just some of these objects aren't set up to allow this.
Inserting layers before load should again give some performance gains. I don't know
when I'll get a chance to implement this but I will have to do it at some point.
I also will definately revamping some of the events code. All mouse events are
enabled on all layers that have mouse listeners - this can be optimized further by
handling only mouse events which there is a listener. And do as much processing at
the document level as possible.
> various loops. The other down side to the API is when
> the page is been unloaded. It goes out and destroys
> all the existing objects before unloading the page. Is
> that necessary?
No it's not necessary, I don't know who added that or why (maybe for proper resize
fixing?). But I've disabled it in my working version, you can do that also by editing
dynapi.js at this line:
//onunload = function() { DynAPI.unloadHandler(); };
Regards,
Dan Steinman
_______________________________________________
Dynapi-Dev mailing list
[EMAIL PROTECTED]
http://www.mail-archive.com/[email protected]/