You need to make sure that the Table control is fully loaded before calling any methods that will update the data such as AppendRow, SetRows, RemoveRows and the likes.
cfg.Light
cfg.MUI
function OnStart()
{
lay = MUI.CreateLayout("Linear", "FillXY,VCenter")
var values1 = [ "John:24:deepPurple", "Jane:22:deepPurple", "Jonathan:26:deepPurple" ]
var values2 = [ "Doe:12:deepPurple", "Dawn:20:deepPurple", "Dane:16:deepPurple" ]
table = MUI.CreateDataTable("Name,Age,Color",values1, 1, 0.4, 'selectable')
lay.AddChild(table);
setTimeout(function() {
table.SetRows(values2)
}, 2000)
app.AddLayout(lay)
}