• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Loading an HTML Table without Moving Row Pointer

 
Steve Dyke
Ranch Hand
Posts: 1629
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 64990
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
"row pointer"? There's no such thing. Do you mean "focus"? Or the scroll point? Either can be controlled.
 
Steve Dyke
Ranch Hand
Posts: 1629
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic