vendredi 26 décembre 2014

Define templates directory for ListView Titanium create with JS code


So in Alloy we can declare a list and use require to import templates that are in other directories as show in:



<ListView id="list" defaultItemTemplate="comment_item">
<Templates>
<Require src="place_templates/comment_template"/>
<Require src="place_templates/see_all_template"/>
</Templates>
<ListSection id="section"/>
</ListView>


But if I made the list through JS code, how I can set the templates in the list view creation?



listView = Ti.UI.createListView({
templates : { 'template_name': 'How I can put the directory of the template?' }
});


I looked for code examples, but there only way I found was to create all the templates through code and setting them in the list view creation, but if the project has already templates, how can I use them in a JS generated list. Thanks a lot!





Aucun commentaire:

Enregistrer un commentaire