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

multiple items within a view from JSON

$
0
0

Hello all.

I have a data source which returns a collection of items which looks like this

var data = [{"Id":"1","ItemName":"football"},{"Id":"2","ItemName":"tennis"}]
after the data is displayed, I plan to iterate through, displaying each Item and their name like
var i;
for (i = 0; i < data.length; i++) {
    data[i].ItemName
}
I now want to dynamically add the results into an Alloy View I have, which looks like
<Window id="win">
    <View id="view">
        <Label id="itemName"></Label>
    </View>
</Window>
But! I have no idea how to bind the data to the view, Any help, sample code, tutorial or push in the right direction will be much appreciated.

Thank you


Viewing all articles
Browse latest Browse all 8068

Trending Articles



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