In order to populate a data-grid that receives array of row objects, I am looking for a good solution to convert an array such as this:
[
[\'country\', \'p
You would need to use a bit of iteration to do this! The following code is an untested example to demonstrate what you would have to do.
function convertToObjectArray(table)
{
var output = [];
for(var i = 1; i < table.length; i++)
{
var obj = {};
for(var x = 0; x < table[0].length; x++)
obj[table[0][x]] = table[i][x];
output.push(obj);
}
return output;
}
Another note with this example is you should edit this, however, to make sure the subsequent arrays are the same length or you could run into null values.