aspose file tools*
The moose likes HTML, CSS and JavaScript and the fly likes Loading an HTML Table without Moving Row Pointer Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "Loading an HTML Table without Moving Row Pointer" Watch "Loading an HTML Table without Moving Row Pointer" New topic
Author

Loading an HTML Table without Moving Row Pointer

Steve Dyke
Ranch Hand

Joined: Nov 16, 2004
Posts: 1446
    
    1
I have a select list and an HTML table on my page. The function is to click an element in the list then click in a table cell and the cell populates with whatever was selected.

On mouse up the div holding list and div holding table are reloaded(jQuery) to remove slected element from list and show in table.

This works great except when table coordinate y is longer than screen. However, then the table is longer the user selects a list element, scrolls down the table to find correct row, cell, clicks the cell to populate with selected element.

Then as expected the reload fires and the table is scrolled back to top. So the user has a lot of extra scrolling to do. Is there a way to reload the table div and keep the row pointer on the last selected cell?
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61224
    
  66

"row pointer"? There's no such thing. Do you mean "focus"? Or the scroll point? Either can be controlled.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Steve Dyke
Ranch Hand

Joined: Nov 16, 2004
Posts: 1446
    
    1
Bear Bibeault wrote:"row pointer"? There's no such thing. Do you mean "focus"? Or the scroll point? Either can be controlled.


I think I got it to work by giving each cell an id. On the save function I scope this id value to session attribute then when the form reloads I use jQuery and focus to the saved id.
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Loading an HTML Table without Moving Row Pointer