get html objects values
get html objects values
I have columns with html objects. I am rendering them well with "sType": "html" and they shows correctly, but how can I get their values:
my checkboxes ids have these values cbSend_id where id is an id number to identify every checkbox on each row
I want to know if the checkbox is checked or not
The other html object I am using is select combo boxes objects and their ids are called on this way: selPrint_id where again id is an id number to identify every select on each row
How can I get the selected value in the list?
I can get with no problem a simple text value in a column with:
var aTrs = dTable.fnGetNodes();
for ( var i=0 ; i
my checkboxes ids have these values cbSend_id where id is an id number to identify every checkbox on each row
I want to know if the checkbox is checked or not
The other html object I am using is select combo boxes objects and their ids are called on this way: selPrint_id where again id is an id number to identify every select on each row
How can I get the selected value in the list?
I can get with no problem a simple text value in a column with:
var aTrs = dTable.fnGetNodes();
for ( var i=0 ; i
This discussion has been closed.
Replies
There are a couple of ways to get the actual table nodes:
1. If the node you want is visible on the page you can use standard DOM queries.
2. Use fnGetNodes() as in your post. fnGetNodes() will get an array of all TR elements, and you can then perform standard DOM or jQuery operations on them. fnGetData() will just get an array of data - not the nodes. So you could use:
[code]
var nTrFirstRow = dTable.fnGetNodes()[0];
var anTdsFirstRow = $('td', nTrFirstRow);
[/code]
And anTdsFirstRow is a jQuery object (can be treated as an array) with each TD element from the row.
Hope this helps,
Allan