Quantcast
Channel: Appcelerator Developer Center Q&A Unanswered Questions 20
Viewing all articles
Browse latest Browse all 8068

implement controllers in listView

$
0
0

hi all, i want to use createController method to implement some view from old code which was working based on table view,

so instead of re write the row again with its all details and subControllers in it , i need some way to use createController method in listView code , and i couldnt use require in the XML because i need this for API which means dynamic data , so i dont know how many list item i should put

any way heres some code to understand what i want

var myTemplate = {
                childTemplates : [{
                    type : 'Ti.UI.View', 
                    bindId : 'row', 
                }]
            };
 
// loop of the API will occure here according to API data length
            var listSectionData = [{
                row : Alloy.createController('productRow', data.products[0]).getView()
            }];
            $.contentTable.defaultItemTemplate = 'template';
 
            $.contentTable.templates = {
                'template' : myTemplate
            }
 
            listViewSection.setItems([listSectionData]);

the "productRow" controller has alot of details so i dont want to rewrite it again instead of this i need to implement it dynamically in the listView


Viewing all articles
Browse latest Browse all 8068

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>