Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Using jQuery livequery to highlight a table row

Posted on 2010-08-18
2
Medium Priority
?
614 Views
Last Modified: 2012-06-21
I'm trying to highlight a row with jQuery and plugin livequery. I can do it fine if the table is loaded into the page initially, but if I try to dynamically load the table, the livequery is not working.

Is this possible? I've googled it but I don't see any examples doing what I need to do. Normally I would use the jQuery plugin flexigrid which handles it by binding the rows as they are appended but that is not what I want to do.

I want to be able to have a page loaded, click a link to display table data and onclick of the rows in that table, highlight the clicked row and remove the highlight from any previously clicked rows.

????
$('#tableid tbody tr ').livequery('click',function(e){
        
    ... take action here ...
        
});

Open in new window

0
Comment
Question by:Webspeeder
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 16

Accepted Solution

by:
JF0 earned 1000 total points
ID: 33467975
I am not familiar with livequery but based on your goal I would just use the build in jquery live function. The live function was specifically created to handle objects created on a page after it has loaded.

Reference:
http://api.jquery.com/live/

Usage:
$('.clickme').live('click', function() {
  // Live handler called.
});
0
 

Author Comment

by:Webspeeder
ID: 33468125
I've been using livequery for a long while now, maybe it was replaced by live. .live worked though.

Thanks for the info.
0

Featured Post

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

DOM Attributes and Properties treatment with jQuery 1.6 by Ivo Stoykov jQuery (http://jquery.com/) 1.6 introduces .prop() (http://api.jquery.com/prop/) and .removeProp() (http://api.jquery.com/removeProp/) methods which allow modifying or removi…
How to build a simple, quick and effective accordion menu using just 15 lines of jQuery and 2 css classes
The viewer will learn how to dynamically set the form action using jQuery.
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
Suggested Courses

604 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question