Open sobytes opened 9 years ago
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
Hi All,
How do i export the result to the view?
And my view
Can you tell me where i am going wrong?