I want to find all checked rows and then grab all the values from each cell for each row.
So what I did was this
var checked = $('.chk_plannerCheckBoxes :checked').parent('span').parent('td').parent('tr');
So this found me the all the checked rows what I wanted.
Next I want to go through each row one by one and get the row and then all the cells from that row through ajax to the server for processing.
jQuery.each(checked, function(i, value)
// this grabs all the cells from the row.
var cells = $(value).children('td');
// I tried to then grab the value say from cell 1 but I always just get and error. I also tried .html() but got the same thing. I also tried just to send cells but it just sends the objects name.
var test = cells.val();
// send to server.
This all happens when a button is clicked by the way.
Bear Bibeault wrote:Hmm, not sure where you are going with that...
In order to use .val() you need a wrapped set. So if you have a DOM element you can wrap it in $() to create a new wrapped set, or you could look into using a method like eq().
Also, check out the .parents() method.
Oh I did not know you can wrap the returned object to make it usable with jquery again. I am not sure what you mean by "Hmm, not sure where you are going with that..." if your talking about the innerHTML it seems to have the value of the cell and that's really all I am after.
So is doing .parents() faster then doing it the way I am doing or is just less code?