qx.data.store.Jsonp:configureRequest未将请求作为参数

发布于 2024-08-26 05:54:55 字数 321 浏览 2 评论 0原文

当像这样创建一个新的 qx.data.store.Jsonp 对象时...

var store = new qx.data.store.Jsonp(url, {
  configureRequest: function(req) {
    req.setParameter("key", "resources.appsrvs");
  }
},"callback");

...委托函数 configureRequest 不会将请求作为参数获取,如 qx.data.storeInterface.IStoreDelegate 中所述。那么我该如何配置请求呢?

when creating an new qx.data.store.Jsonp object like this...

var store = new qx.data.store.Jsonp(url, {
  configureRequest: function(req) {
    req.setParameter("key", "resources.appsrvs");
  }
},"callback");

... the delegate function configureRequest does not get the request as parameter as described in qx.data.storeInterface.IStoreDelegate. so how can i configure the request?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

合久必婚 2024-09-02 05:54:55

不幸的是,不是按照你想要的方式。 Jsonp 存储使用 ScriptLoader 对象,因为它是为跨域请求而设计的。因此,您的委托被使用,但传递给它的“req”对象实际上是一个 qx.io.ScriptLoader 实例。请参阅 ScriptLoader 以及 此处了解一些其他详细信息。

如果您不打算执行跨域请求,请考虑使用 qx.data.store.Json 代替。

Unfortunately, not in the way you intend. The Jsonp store uses a ScriptLoader object, as it is designed for cross-domain requests. So your delegate is used, but the 'req' object passed to it is actually a qx.io.ScriptLoader instance. Please see the API doc for ScriptLoader and also here for some additional details.

If you are not planning to do a cross-domain request, consider using qx.data.store.Json instead.

会发光的星星闪亮亮i 2024-09-02 05:54:55

这可能与 qx.data.store.Jsonp 内部似乎使用 qx.io.ScriptLoader 的事实有关,文档中说 EXPERIMENTAL –尚未准备好投入生产

另外,您没有指定您使用的 qooxdoo 版本。在 1.0.x 之前,我认为 qx.data.store.Jsonp 只是一个空存根。

你的函数被调用了吗?如果是的话,它会作为参数传递什么?

最后考虑提交错误报告。

It might have something to do with the fact that qx.data.store.Jsonp internally seems to use qx.io.ScriptLoader for which the documentation says EXPERIMENTAL – NOT READY FOR PRODUCTION.

Also you didn't specify which version of qooxdoo you use. Prior to 1.0.x I think qx.data.store.Jsonp is just an empty stub.

Does your function get called at all? If yes what does it get passes as parameters?

And finally consider just filing a bug report.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文