Domanda

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.

È stato utile?

Soluzione

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.

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top