使用HTTP Adapater进行同步的IBM Worklight JSON存储 [英] IBM Worklight JSON Store with Sync using HTTP Adapater

查看:133
本文介绍了使用HTTP Adapater进行同步的IBM Worklight JSON存储的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何在应用程序加载时从数据库加载数据?
如何将数据推送到数据库?
IBM Worklight提供的示例有助于从JSON存储加载数据,但如何使用HTTP Adapter获取数据并加载?

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?

推荐答案

阅读文档并查看JSONStore 入门模块和代码示例。

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?

使用加载。您也可以使用 WL.Client.invokeProcedure jQuery.ajax 然后致电< a href =http://pic.dhe.ibm.com/infocenter/wrklight/v5r0m6/topic/com.ibm.worklight.help.doc/apiref/r_wl_jsonstore_add.html\"rel =nofollow>添加使用响应数据。

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?

使用推送或使用 getPushRequired 并使用 WL.Client.invokeProcedure jQuery.ajax 将数据发送回后端。

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.

这篇关于使用HTTP Adapater进行同步的IBM Worklight JSON存储的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆