[Solved] Reading row value
[Solved] Reading row value
I have rows with check box as follow which has unique value for each.
[code][/code]
Then I am storing all rows in a variable.
[code]var aTrs = oTable.fnGetNodes();[/code]
Now simply I want to display that unique value. I am trying with "value" as
[code]alert(aTrs.value);[/code]
But its not showing that unique value for that row. How can i get that unique value?
Thanks
Anjib
[code][/code]
Then I am storing all rows in a variable.
[code]var aTrs = oTable.fnGetNodes();[/code]
Now simply I want to display that unique value. I am trying with "value" as
[code]alert(aTrs.value);[/code]
But its not showing that unique value for that row. How can i get that unique value?
Thanks
Anjib
This discussion has been closed.
Replies
[code]
var valueStorageArray = [];
var columnWithTheCheckbox = 3 // This assumes that the 4th column from the left has the checkbox, based on a starting column index of 0.
for(var i in aTrs)
{
// i is the row & delete is the name of the checkbox
var nCheckbox = aTrs[i][columnWithTheCheckbox].delete;
if(nCheckbox.checked) valueStorageArray.push(nCheckbox.value);
}
[/code]
That will give you an array of all checked checkbox values. You can then do whatever you need with them.