Some quick background:
I'm developing a portlet to be deployed in Liferay 4.2.1.  They use
prototype as their javascript framework.  One function that is used in
a couple of places is getElementsByClassName.  I have problems with
the use of that function because of its use of getElementsByTag("*").
I even altered getElementsByClassName to take a third argument so as
to replace the call as getElementsByTag(tagName || "*").  That only
offered a moderate performance increase.  Performance is an issue
because my portlet is essentially a 35x900 table, which is
unavoidable.

I am now considering walking the DOM, since getElementsByClassName was
being used to only fetch the 0'th element of the returned array.  If
anyone knows of a quick way to nab the first matching element, please
tell me!  I am new to prototype, but it seems pretty straightforward
to use.  A function like "getFirstElementByClassName" would be
spectacular in this case, especially if it didn't retrieve all
descendent nodes in the process.

I thought about implementing it myself using prototype's up/down/
previous/next functions, but as far as I can tell reading the source,
those functions also get all descendents via
recursivelyCollect(previousSibling/nextSibling).

Am I mistaken about how recursivelyCollect works in the above cases?
Will recursivelyCollect('nextSibling') dive through all descendents,
or just those one level deep?


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Spinoffs" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-spinoffs?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to