Accessing cell values in a table

Accessing cell values in a table

Madhu12Madhu12 Posts: 32Questions: 0Answers: 0
edited December 2012 in General
I have check box as one of the columns in my table which uses DataTable plugin. Here I get the selected rows in a array and trying to access the value of the second column of each of these selected like below.

[code] $('#submit_id').click(function () {
var sData = oTable.$('input').serializeArray();
for(var i=0; i

Replies

  • girishmrgirishmr Posts: 137Questions: 0Answers: 0
    edited December 2012
    Try this

    [code]

    var nTr = this.parentNode;
    var aData = oTable.fnGetData( nTr );
    [/code]

    Access cell value from aData
    [code]
    aData[0]; // First cell value
    [/code]
  • Madhu12Madhu12 Posts: 32Questions: 0Answers: 0
    Thanks for your suggestion. Infact I had tried
    [code]
    $('#table-id tbody tr:has(:checked)').each( function () {

    });
    [/code]

    it worked.
This discussion has been closed.