Example Wanted
fatbearinc opened this issue · 1 comments
fatbearinc commented
This looks very exciting, but I'm having some issues getting started.
I'd like to be able to read a schema from a file with some initial data from another file and then have the page work. Can someone provide a full index.html to do this?
This would be very useful!
idelvall commented
Hi, you need to have the schema and data loaded as javascript variables.
You can load the files by:
- downloading them using AJAX (http://stackoverflow.com/questions/196498/how-do-i-load-the-contents-of-a-text-file-into-a-javascript-variable)
- use AJAX with local urls (file:///home/user/file.json) to load files from your local machine (http://stackoverflow.com/questions/1903959/access-local-files-with-local-javascript)
- load their contents using FileReaders http://stackoverflow.com/questions/3582671/how-to-open-a-local-disk-file-with-javascript
Once you have the variables loaded you can follow the steps in the documentation. More examples here (https://github.com/brutusin/json-forms/blob/gh-pages/index.html)