Read cell value from any row of a specific column - seems simple yet....

Read cell value from any row of a specific column - seems simple yet....

Krishnan503Krishnan503 Posts: 3Questions: 1Answers: 0
edited August 2015 in Free community support

The datatable is created from an SQL table and its loading perfectly. Its got 6 columns and 1000 records - one of which is my column of interest, named Division, and its the same value in all 1000 records, so any cell in that column would work.

Now all I want to do is read a cell value from a specific column named 'Division' and put it into a variable for use elsewhere in the HTML.

This seems pretty basic. I've tried a few variations but not able to do this. Any suggestions?

$(document).ready(function() {
var table = $('#table-div').dataTable( {
"aLengthMenu": [[50, 100, 500, -1], [50, 100, 500, "All"]],
"iDisplayLength": 50,
destroy: true
});

/*var table = $('#table-div').dataTable();
var divNametest = table[1]["Division"];

var divNametest= $('#table-div tbody tr:first td:first').text();
*/
var table = $('#table-div').dataTable();
var divNametest= table.cell(1,2).data();

What am i doing wrong?

This discussion has been closed.