--- Benoit Marchant <[EMAIL PROTECTED]> wrote:
> ...I think we
> should take a different approach: create your
> dynlayers or widget
> exactly as you usually do with their regular
> constructors.
> Now, if you already have the html in the page
> representing the divs of
> the objects you created, you would call an
> equivallent to
> document.insertAllChildren() which would be
> assignInlineElementToAllChildren() in the onload.
Agree, but the user would have to add that line
manually (similar to the way we not do
insertAllChildren()):
<script>
dynapi.document.assignInlineElementToAllChildren()
</script>
> This method would
> crawl the tree of dynlayers, and call on each one:
>
> DynLayer.prototype.assignInlineElement = function {
> var p = this.parent;
> > if (!p) pobj = dynapi.document;
> > else if (p.isClass && p.isClass('DynElement'))
> pobj = p;
> >
> > if (pobj) {
> > if (dynapi.ua.ns4) elm = pobj.doc.layers[id];
> > else if (dynapi.ua.ns6) elm =
> pobj.doc.getElementsByID(id);
> > else if (dynapi.ua.ie) elm = pobj.doc.all[id];
> > }
> > if (!elm) return alert("DynLayer_inline Error:
> did
> > not find element "+id);
>
> > this.elm = elm;
> > if (dynapi.ua.ns4) dlyr.doc = elm.document;
> > DynLayer._updateValues(this);
> > DynLayer._assignElement(this,elm);
> > DynElement._flagEvent(this,'create');
>
> }
>
> That way I think it's a much cleaner design that
> scales better. What do
> you think ?
Very good! I like this approach. The only thing is
that the user would have to call setID() for each
layer, but that's not a problem.
var lyr=DynLayer()
lyr.setID('mydiv');
This would allow users to build complex inline widgets
and then have the system assign the elements to the
complex DynAPI structure. Briliant! The one problem
that I see is that inline wigdets will not be as
flexible as ordinary widgets, but they're great for
those who would want to automate the creation of
widgets/layers. Inline widgets for the most part will
have fixed parent-child relationships which is more
suitable for application specific widgets.
Benoit, I would suggest that you spear-head this new
implementation. You might also have to modify the docs
to indicate the importants of making sure
relationships are properly maintained when using
DynAPI Inline Widgets. All coding for this
implementation IMO should stored inside
dynlayer_inline.js
Keep up the good work!
--
Raymond Irving
> Benoit
>
__________________________________________________
Do you Yahoo!?
Yahoo! Tax Center - forms, calculators, tips, more
http://taxes.yahoo.com/
-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
_______________________________________________
Dynapi-Dev mailing list
[EMAIL PROTECTED]
http://www.mail-archive.com/[EMAIL PROTECTED]/