Page 1 of 1

Using a local json file as a service in an app

Posted: Fri Aug 09, 2013 9:30 pm
by John5269257

Hi

My locally-installed app need to populate a repeating grid from a local json file.
I've tried to build a service using "file:///path/filename.json" as the url, but nothing is returned. First question: is this possible?

I just saw response in the topic below:
https://getsatisfaction.com/apperyio/...

This makes me wonder if I could build a simple generic service that just parsed the local json file. If I did so, is there a way of mapping the results array to the grid?

A very simple example would be very helpful :)

Thanks,
John


Using a local json file as a service in an app

Posted: Fri Aug 09, 2013 10:01 pm
by maxkatz

I doubt file:/// work work as the URL is simply used to construct a jQuery Ajax call.

You could use a Generic service, this will allow you to use the mapping feature. As for reading JSON from a local file.. check the browser File API. You might find other ways to do it.


Using a local json file as a service in an app

Posted: Fri Aug 16, 2013 5:13 pm
by Toblerone

Anyone got any examples of this workingplease?


Using a local json file as a service in an app

Posted: Fri Aug 16, 2013 5:27 pm
by maxkatz

We don't have this specific example.


Using a local json file as a service in an app

Posted: Fri Aug 16, 2013 5:47 pm
by Toblerone

Is there an example on creating a generic service then where i could write some javascript to read teh json and use for mapping?


Using a local json file as a service in an app

Posted: Fri Aug 16, 2013 5:58 pm
by maxkatz