File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
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
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: 1490
    
    1
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: 61766
    
  67

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: 1490
    
    1
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: 61766
    
  67

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: 61766
    
  67

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