Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Marking the current Selected Table Row

 
Steve Dyke
Ranch Hand
Posts: 1642
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have an html table in which the first coulmn holds record index numbers as links for editing the record. How can I when the user clicks a particular link in the column is is marked so they can redily identify which link they have currently selected.
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 65115
89
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Simulate a checkbox? Change the background color? Make it do the jig? Give it a border?

The visual possibilities are endless.

If you are using jQuery and jQuery UI there is widget (named Selectable) that makes any element in the DOM "selectable".
 
Steve Dyke
Ranch Hand
Posts: 1642
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Bear Bibeault wrote:Simulate a checkbox? Change the background color? Make it do the jig? Give it a border?

The visual possibilities are endless.

If you are using jQuery and jQuery UI there is widget (named Selectable) that makes any element in the DOM "selectable".


I can mark or highlight the row or cell when the link is clicked and my js runs using jquery and css. But it is when another slection is made, how to know which row or cell to unmark.
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 65115
89
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If you are already using jQuery, download jQuery UI and use the Selectable widget. It'll make all of this very easy.
 
Eric Pascarello
author
Rancher
Posts: 15385
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Steve Dyke wrote:how to know which row or cell to unmark.


How do you mark it? Seems logical to either remember the last selected row or make a selector that can find it and unmark it. Seems as simple as removing a class name.

Eric
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 65115
89
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I think that most people think that they need variables to retain state, and never think of using classes to record state.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic