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.

Était-ce utile?

La solution

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.

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top