I am trying to add a row to the table. The table is created in alloy and I am trying to append the rows from the js.
Here is the xml
<Alloy>
<Window id='index' class="container">
<TableView id="MainThings">
<TableViewSection id='MainThingsSection'>
</TableViewSection>
</TableView>
<Label id="AddCounter" onClick="doClick">+</Label>
<Label id="clear" onClick="clear">-</Label>
</Window>
Here is the .js
function Loader(){
var row= Titanium.UI.createTableViewRow({
title:'Title'
});
$.MainThingsSection.append(row);
}$.MainThings.addEventListener('open',Loader());
$.index.open();
Here is the error
[ERROR] : Script Error {
[ERROR] : backtrace = "#0 () at file:///Users/stephenhanrahan/Library/Developer/CoreSimulator/Devices/C088B99B-2086-4FA3-AABD-85E2B4BE3944/data/Containers/Bundle/Application/A8E9395F-44CF-4699-92EC-9638E2473142/I%20Have%20This%20Many.app/alloy.js:265";
[ERROR] : line = 93;
[ERROR] : message = "Invalid type passed to function";
[ERROR] : nativeLocation = "-[TiProxy addEventListener:] (TiProxy.m:824)";
[ERROR] : nativeReason = "expected: Function, was: NSNull";
[ERROR] : sourceId = 286306016;
[ERROR] : sourceURL = "file:///Users/stephenhanrahan/Library/Developer/CoreSimulator/Devices/C088B99B-2086-4FA3-AABD-85E2B4BE3944/data/Containers/Bundle/Application/A8E9395F-44CF-4699-92EC-9638E2473142/I%20Have%20This%20Many.app/alloy/controllers/index.js";
[ERROR] : }