wood burning stoves 2.0*
The moose likes HTML, CSS and JavaScript and the fly likes Marking the current Selected Table Row Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "Marking the current Selected Table Row" Watch "Marking the current Selected Table Row" New topic
Author

Marking the current Selected Table Row

Steve Dyke
Ranch Hand

Joined: Nov 16, 2004
Posts: 1393
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

Joined: Jan 10, 2002
Posts: 60782
    
  65

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".


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

Joined: Nov 16, 2004
Posts: 1393
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

Joined: Jan 10, 2002
Posts: 60782
    
  65

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

Joined: Nov 08, 2001
Posts: 15376
    
    6
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

Joined: Jan 10, 2002
Posts: 60782
    
  65

I think that most people think that they need variables to retain state, and never think of using classes to record state.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Marking the current Selected Table Row
 
Similar Threads
Using a Dynamic Table on My JSP
Refresh Calling Page
Netbeans - Persistence Add Record To Child Table
a Swing trick
How column can be hidden in JTable without removing from model ?