Nick Scheynen
Posts: 0
Joined: Tue Apr 08, 2014 6:02 pm

Own REST-service to local database

Ok I'm new to appery, but I have worked with phonegap before. I have my own API on my own server and I can successfully load the data and display a list of products in my app.
I know and understand the code to store something in a local database, but I'm having trouble with the link between both.

I tried to map the response to a custom javascript, but I can't drop the '$'-sign on the custom javascript.

What's the right way to work here?

Kateryna Grynko
Posts: 0
Joined: Thu Nov 15, 2012 9:13 am

Own REST-service to local database

Hi Nick,

Do you want to process a service response using JavaScript?

Nick Scheynen
Posts: 0
Joined: Tue Apr 08, 2014 6:02 pm

Own REST-service to local database

I want my user to be able to download our catalogue, so that it is also available offline. So for example the user goes to a download page and presses a button to download all the products from a certain category. On this click event I want the app to get the products from the server (I have made a service for that) and save them in the local database.
On another page the user can see the available categories and on click the app will then show the products from the local database.

Kateryna Grynko
Posts: 0
Joined: Thu Nov 15, 2012 9:13 am

Own REST-service to local database

Nick,

Then you can add service Success event handler. Service response is stored in variable 'data' - so use it as you need.

Nick Scheynen
Posts: 0
Joined: Tue Apr 08, 2014 6:02 pm

Own REST-service to local database

Ok perfect, got it working and the data is in the local database! Can I get it from the local database using a service? Then I would be able to easily map it to the GUI?

Maryna Brodina
Posts: 0
Joined: Thu Apr 05, 2012 7:27 am

Own REST-service to local database

Hello!

Yes, please take a look here http://docs.appery.io/documentation/r...

Return to “Issues”