Solved

Using jQuery livequery to highlight a table row

Posted on 2010-08-18
2
592 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
SharePoint 2013 Searchbox Branding 11 33
CSS Position not returning 2 46
Angular- another way of coding hide and display 3 35
Javascript Hashmap output 8 43
Introduction Knockoutjs (Knockout) is a JavaScript framework (Model View ViewModel or MVVM framework).   The main ideology behind Knockout is to control from JavaScript how a page looks whilst creating an engaging user experience in the least …
Introduction If you're like most people, you have occasionally made a typographical error when you're entering information into an online form.  And to your consternation, the browser remembers the error, and offers to autocomplete your future entr…
The viewer will learn how to dynamically set the form action using jQuery.
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…

947 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

23 Experts available now in Live!

Get 1:1 Help Now