IBM Worklight JSON Store with Sync using HTTP Adapater

限于喜欢 提交于 2019-12-08 13:09:14

问题


How to load data from database on load of the application? How to push data to database? The sample given by IBM Worklight helps to load data from JSON store, but how to use HTTP Adapter to fetch data and load?


回答1:


Read the documentation and look at the JSONStore getting started modules and code samples.

How to load data from database on load of the application?

Use load. You can also do it with WL.Client.invokeProcedure or jQuery.ajax and then call add with the response data.

How to push data to database?

Use push or get the documents with local-only changes with getPushRequired and use WL.Client.invokeProcedure or jQuery.ajax to send data back to the backend.

All the methods linked above have examples. You should be able to figure out how to adapt those examples to your needs.



来源:https://stackoverflow.com/questions/16788577/ibm-worklight-json-store-with-sync-using-http-adapater

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!