Error in finding cell value in jqueery

Posted by Klbaiju under jQuery on 6/12/2014 | Points: 10 | Views : 465 | Status : [Member] | Replies : 4
Hi

I want to find the value of above cell in a grid view using jquery

i tried following code

if ($.trim(cellText) == "0") {
$(this).css('background-color', 'Red');
var $this = $(this);
var $tr = $this.parent();

var col = $tr.children().index($this);
alert(col);


}

above code returns only index value . ineed the value of that cell

how to find out

regards

Baiju




Responses

Posted by: Bandi on: 6/12/2014 [Member] [MVP] Platinum | Points: 25

Up
0
Down
Refer
http://aspdotnetcodebook.blogspot.in/2010/01/how-to-get-cell-value-of-gridview-using.html

Mark This Response as Answer
--
Chandu
http://www.dotnetfunda.com/images/dnfmvp.gif

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

Posted by: Bandi on: 6/12/2014 [Member] [MVP] Platinum | Points: 25
Posted by: Klbaiju on: 6/12/2014 [Member] Starter | Points: 25

Up
0
Down
hi friend
this is my samle output

1500

0

0

0

if the cell value is zero i want to change the background color to red. and also change the background color of top value. here it is 1500.

this code is fine for checking zero and change color.

if ($.trim(cellText) == "0") {
$(this).css('background-color', 'Red');



}

i want to check value of the above cell of all cell contains zero value .and that value greater than zero the i want change the background color.

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

Posted by: Bandi on: 6/12/2014 [Member] [MVP] Platinum | Points: 25

Up
0
Down
This link is having code for fetching next cell value... It might directs you...
http://stackoverflow.com/questions/16543696/select-the-next-td-in-a-table-using-jquery

Mark This Response as Answer
--
Chandu
http://www.dotnetfunda.com/images/dnfmvp.gif

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

Login to post response