【问题标题】:Worklight 6.1 JSONStore remove issue in iPhoneWorklight 6.1 JSONStore 删除 iPhone 中的问题
【发布时间】:2014-10-19 14:47:55
【问题描述】:

我在 iPhone 中使用 WL.JSONStore 遇到了删除文档问题。

我的代码如下:

var jstores = new Array();
for(var i=0 ; i<args.length; i++) {
    var _id = _IDMap[args[i].id];
    var document = {
        _id : _id,
        json: args[i]
    };
    console.log("prepare to remove id: "+_id);
    jstores.push(document);
}
WL.JSONStore.get("dataSet").remove(jstores,{push:true}).then(function(result) {
    console.error("remove num: "+result);
    return true;
}).fail(function (error){
    return false;
});

我想使用 WL.JSONStore.remove 函数来删除一些文档。这在 Android 中运行良好,但在 iPhone 中,无论我要删除多少文档,都只会删除一个文档。 并且回调函数的结果总是等于1...

我不知道为什么。有没有和我一样遇到同样问题的人?我的iOS版本是6.1,iPhone5

【问题讨论】:

    标签: ios iphone ibm-mobilefirst jsonstore


    【解决方案1】:

    【讨论】:

    • 好吧。感谢您的解决方案。我已经尝试过了,现在它在设备上运行良好。但是......在桌面浏览器(Chrome)中,这种方式只能删除一项......一切都是相反的......
    • 如果不是open a PMR,在您更新到最新的修订包后,您的代码应该可以正常工作。如果你多次调用replace(...)remember this line from the docsJSONStore 的 JavaScript 实现需要代码被串行调用。在调用下一个操作之前等待一个操作完成。这可能是它在生产环境(例如 Android、iOS)而不是 JS 实现(例如 Chrome)中工作的原因
    猜你喜欢
    • 2013-12-27
    • 2014-05-11
    • 2014-09-08
    • 2014-11-06
    • 2014-05-22
    • 2014-01-18
    • 2014-08-16
    • 1970-01-01
    • 2013-09-04
    相关资源
    最近更新 更多