append a row with a custom function
I have a function called addRow(data,i) that runs when my app loads and populates a tableview. all is well. i want to use this same function to append a new row to the table but it's not doing anything.
any ideas? I can see the data returned in the console but nothing is appended.
projTable.addEventListener('click',function(e)
{
var xhr2 = Titanium.Network.createHTTPClient();
xhr2.onload = function()
{
var d = JSON.parse(this.responseText);
Ti.API.info(d); // verify data is returned
data = addRow(d,4);
projTable.appendRow(data);
};
xhr2.open('GET','http://get_remote_array.php');
xhr2.send();
});