get html objects values

get html objects values

valdezrvaldezr Posts: 49Questions: 0Answers: 0
edited May 2009 in General
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

Replies

  • allanallan Posts: 63,635Questions: 1Answers: 10,488 Site admin
    Hi aldezr,

    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
This discussion has been closed.