SUPER_USER SUPER_USER - 4 months ago 26
Javascript Question

click on row jquery

I use link-button in grid-view for display popup appear by using this

$(function () {
$('[ID*=lbViewChart]').on('click', function () {
var row = $(this).closest('tr');
var Id = row.find('td')[0].firstChild.data;
var obj = {};
obj.ID = Id;
GetData(obj);
return false;
});


Now i want when user click on row then pop up appear for this i modify this code to this

UPDATED CODE

$(function () {
$('#tabledate tr').click(function () {
var row = $(this);
var Id = row.find('td')[0].firstChild.data;
var obj = {};
obj.ID = Id;
GetData(obj);
return false;
});


but when i click on row nothing happens
any solution?

Answer

Remove

var row = $(this).closest('tr');

from your code you are already on tr. Instead of this use:

var row = $(this).html();