Solved

Using jQuery livequery to highlight a table row

Posted on 2010-08-18
2
589 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
2 Comments
 
LVL 16

Accepted Solution

by:
JF0 earned 250 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

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

What is a Lightbox? A Lightbox is the effect you see when you click, for example, an image and the screen fades out and up pops the same image but in its full size dimensions. There are lots of Lightbox effects for jQuery. Problem is they are a…
Introduction Chart.js, used properly, can visually add a difference to your charting applications. It engages your visitors and allows them to interact with data they otherwise wouldn't be able to without expensive and complicated systems. For this…
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)
The viewer will learn the basics of jQuery including how to code hide show and toggles. 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…

746 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now