how to find header value of gridview using jquery

Posted by Klbaiju under jQuery on 7/9/2013 | Points: 10 | Views : 1543 | Status : [Member] | Replies : 1
Hi i want to find the header value and first value of each row in a gridview using jquery
here is my code

$("#GridView1 tr td").filter(":not(td:first-child)").each(function () {


var cellText = $(this).text();
if ($.trim(cellText) == '') {
$(this).css('background-color', 'LightGreen');


$(this).append("<a href='booking.aspx' title ='click to book'>available</a>");

}
else {
$(this).css('background-color', 'red');
}
});
here iam filtering rows except header value and first child of each row
my requirement is i want to add headervalue and first value of each row(td:first-child) in to anchor tag
like this
$(this).append("<a id="headervalue-firstchild" href='booking.aspx' title ='click to book'>available</a>");
how to solve this
Regards
Baiju




Responses

Posted by: aswinialuri-19361 on: 7/30/2013 [Member] Starter | Points: 25

Up
0
Down
HI ,
refer this link i hope it will help you
http://forums.asp.net/t/1920039.aspx/1?how+to+find+header+value+of+gridview+using+jquery
http://stackoverflow.com/questions/14497721/how-to-get-gridview-row-values-using-jquery

Mark as Answer if it helps you
Thanks&Regards
Aswini Aluri

Klbaiju, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response