Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Output result to xml #71

Open
sobytes opened this issue Aug 25, 2015 · 1 comment
Open

Output result to xml #71

sobytes opened this issue Aug 25, 2015 · 1 comment

Comments

@sobytes
Copy link

sobytes commented Aug 25, 2015

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?

@sobytes
Copy link
Author

sobytes commented Aug 25, 2015

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant