On May 23, 1:04 am, Jay Tee <[EMAIL PROTECTED]> wrote:
> On May 21, 11:26 pm, RobG <[EMAIL PROTECTED]> wrote:
[...]
> > If you must use script, you can use the rowIndex property (which is
> > relative to all the rows in the table) of the row you are in as the
> > basis for going to the upper or lower row.
>
> > e.g.
>
> > function upRow(tr)
> > {
> > var tableParent = tr.parentNode.parentNode;
> > return tableParent.rows[ tr.rowIndex - 1 ];
> > }
>
> I wasn't aware of the rowIndex property! Thanks for the tip :)
> I'll try using that and see what happens. I'm assuming that the
> rowIndex is for the whole table and is not affected by any tbody and
> thead tags?
It's amazing what you find when you read the spec :-)
rowIndex:
<URL: http://www.w3.org/TR/DOM-Level-2-HTML/html.html#ID-67347567 >
sectionRowIndex:
<URL; http://www.w3.org/TR/DOM-Level-2-HTML/html.html#ID-79105901 >
--
Rob
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---