napp.alloy.adapter.restapi
napp.alloy.adapter.restapi copied to clipboard
Output result to xml
Hi All,
How do i export the result to the view?
var api = Alloy.createCollection("api");
api.fetch({
url: "http://jsonplaceholder.typicode.com/posts",
// uncomment and add data to post
//data : {},
add: true,
silent: true,
processData : false,
success : function(_model, _response) {
Ti.API.info(_response);
},
error : function(_model, _response) {
Ti.API.info('Events Fetch Error');
Ti.API.info(_response);
}
});
And my view
<Alloy>
<Collection src="api"/>
<Window class="container" onOpen="windowOpen">
<TableView id="table" dataCollection="api">
<TableViewRow>
<Label text="{title}"></Label>
<Label text="{body}"></Label>
</TableViewRow>
</TableView>
</Window>
</Alloy>
Can you tell me where i am going wrong?
Ok sussed it i have put together a little sample project for newbie like me to save some time.
https://bitbucket.org/SoBytes/napp.alloy.adapter.restapi-alloy-example/src