I collect an array of rows because I want to do row.show()/row.hide()
later on in the code.  I thought the code would look cleaner this way
as oppose to doing cell.up('tr').show()/hide().

And I tried using #down() and #firstDescendant() instead of
#childNodes[0] but I always get a "...has no properties" message
whenever I do.  I'm running Firefox 2.0 on Ubuntu.

-- Jon



On May 19, 3:45 pm, kangax <[EMAIL PROTECTED]> wrote:
> Why not just do $$('.content-row .Platform_Category')?
> Also, a safer alternative to childNodes[0] is #firstDescendant or
> #down
>
> - kangax
>
> On May 19, 5:25 pm, Jonathan_C <[EMAIL PROTECTED]> wrote:
>
> > I'm writing some code to subset a table based on the contents of
> > particular columns.  My event handler starts off like this:
>
> >   subsetChange: function(e) {
> >     var subset = $F('subsetSelector');
> >     var rows = $$('.content-row');
> >     rows.each(function(row) {
> >       var value = row.down('.Platform_Category').childNodes[0].data;
> >       switch (subset) {
>
> >       ... show/hide rows based on whether the value matches the user
> > selected subset ...
>
> > My question is whether there is a more Prototype-ish way to get the
> > values from my table cells instead of using ".childNodes[0].data".
>
> > Thanks in advance for any advice.
>
> > -- Jon
--~--~---------~--~----~------------~-------~--~----~
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 rubyonrails-spinoffs@googlegroups.com
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