Hi,

I'm trying to retrieve some results from a data array. The data inside result.data[i][col] is there any way to break down the result so that I can retrieve individual row or column of data?

var result = selectStmt.getResult();

var row;
var cell;

var tbl = document.getElementById("resultsGrid");
tbl.innerHTML = "";

var numRows = result.data.length;

for (var i = 0; i < numRows; i++)
{
if (i == 0)
{
// add the table header
row = document.createElement("tr");

for (col in result.data[i])
{
cell = document.createElement("th");
cell.innerText = col;
row.appendChild(cell)
}

tbl.appendChild(row);
}

// iterate over the columns in the result row object
row = document.createElement("tr");

for (col in result.data[i])
{
cell = document.createElement("td");
cell.innerText = result.data[i][col];
row.appendChild(cell);
}

for (col in result.data[i])
{ // Create the link
cell = document.createElement("td");
cell = document.createElement('a');
cell.setAttribute('href', '#');
cell.addEventListener('click', function(evt){
document.getElementById("course-title").value = result.data[1][col];
});
//cell.innerText = "Load"
cell.innerText = result.data[i][col];
row.appendChild(cell);
}

tbl.appendChild(row);
Thanks