if you are using alloy, you should create the list in XML, in the actual view file. then you can do stuff with it in the controller using $.list, as you do in your first option.
Alloy: correct way to create and use a ListView?
-
07-07-2023 - |
Question
What is the proper way to separate the view and controller with Alloy?
someController.js:
$.list.setSections(sections);
,
I know this populates a ListView with id='list' in the XML markup...
or
var list = Ti.UI.createListView({stuff})
and then somehow push the list out to the view.
I am not sure what the best way is to keep in spirit with MVC.
Solution
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow