aspose file tools
The moose likes HTML, CSS and JavaScript and the fly likes On Key Press select a row in table Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCA Java SE 8 Programmer I Study Guide 1Z0-808 this week in the OCAJP forum!
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "On Key Press select a row in table" Watch "On Key Press select a row in table" New topic
Author

On Key Press select a row in table

Patricia Samuel
Ranch Hand

Joined: Sep 12, 2007
Posts: 300
Hi all,

I have table that is scrollable. Whenever user clicks on a row , the row get selected. Now our client wants that whenever UP or Down Arrow key is pressed the row get selected. I am not able to understand how to do this.
<Div style ="overflow-y:auto"
<table >
<c:foreach...>

<tr on click ="calljavascript"><td>

</tr>
</c:foreach>
</table>
<div>

This is just a skelteon to clear what i want. I used on keypress="call javascript" but onkey scrolls Browser not the content of that table. I don't know how to do this. can anyone help me in this dilemma.
Thanks a lot to all
Eric Pascarello
author
Rancher

Joined: Nov 08, 2001
Posts: 15376
    
    6
Somethign I did for another Rancher: http://www.pascarello.com/examples/ActiveZebra.html

One thing it needs to do that I never coded in it is to scroll the page if the highlighted roww goes off the screen.

Eric
Patricia Samuel
Ranch Hand

Joined: Sep 12, 2007
Posts: 300


Need code to implement.
Eric Pascarello
author
Rancher

Joined: Nov 08, 2001
Posts: 15376
    
    6
View the source...??

Eric
Patricia Samuel
Ranch Hand

Joined: Sep 12, 2007
Posts: 300
Hi All,

Can anyone help me to select a row in table using arrow keys.
I used this link to apply the functionality

http://projects.arkanis-development.de/table_navigation/

but nothing was helpful for me...it does not work on key press...

I did exactly the same way it is using...but instead the table scrolls it is scrolling my Window.(Firefox)

Or give me some alternative solution to implement this.

Thanks
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: On Key Press select a row in table