Playframework 和 ExtJ 之间的连接
我正在做一个项目,我试图用 playframework 制作后端,用 Extjs 制作前端。
我可以使用 Json 从服务器检索数据,并将其显示在网格中及其所有字段。
当我尝试修改、删除或添加任何记录时,问题就出现了。
Ext发送的请求:DELETE lista?_dc=1318409614652
(我通过代理用“noCache: false”解决了_dc)
现在的请求是:DELETE lista
我需要的请求是:DELETE lista/“对象的参数,如ID或名字”
你对此有什么想法吗?如果您需要任何信息,请告诉我,
提前致谢!
I am doing a project were I am trying to make the backend with playframework and the frontend with Extjs.
I can retrieve the data from the server with Json and show it in a grid with all it's fields.
The problem comes when I try to modify, remove or add any record.
The request sent by Ext: DELETE lista?_dc=1318409614652
(I solved _dc with "noCache: false" over the proxy)
The request right now is: DELETE lista
The request I need is: DELETE lista/"parameter of the object like ID or name"
Do you have any idea about this? If you need any information let me know
Thanks in advance!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我想您还没有使用 休息代理(ExtJS)为此,但你应该这样做,因为它正是你所要求的。根据您的情况,您可以使用
/lista
之类的 url 进行设置。现在,当您删除记录时,代理会自动向 url 发送DELETE
请求,并在其后面附加 id。查看文档(上面链接)以获取更多信息 - 您可以稍微控制 url 生成,但在您的情况下,您似乎可以使用默认选项。I suppose you are not yet using the Rest proxy (of ExtJS) for this, but you should, as it does exactly what you are asking for. You set it up with an url like
/lista
in your case. Now, when you delete a record, the proxy automatically sends aDELETE
request to the url, appending it with the id. Check out the documentation (linked above) for more info - you can control the url generation a little bit, but in your case it looks like you can do with the default options.即使您不想使用 Rest Proxy,您仍然可以使用 Ext.Ajax.request ,如下所示。
even if you don't want to use Rest Proxy, you use still use Ext.Ajax.request like below.