On May 21, 11:26 pm, RobG <[EMAIL PROTECTED]> wrote:

>
> Users can navigate using the tab key (zero script required), you can
> control the order using the tabindex attribute.
>

The app is actually a conversion from a PC-based application to a web-
based version.  From a usability standpoint, the users have become
accustomed to using certain key combinations when entering data.  (I'm
currently trapping the keypress event to deal with their inputs):
1.  TAB key - move to next field
2.  Shift+TAB - move to previous field
3.  ENTER key - submit new value and move to the next row down
4.  ARROW keys - move the cursor between fields (some of the grids are
fully editable, so left and right become a factor)

In each of the cases where I'm moving the cursor to a text input, I'm
using the 'activate' method to select the text - so they can just
start typing their new values.

> 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?

Thanks,

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