如何使用 Direct store 在 Ext JS 中设置远程自动完成?
阿罗哈!
我正忙于一个项目,遇到了一个问题:当使用具有 Direct 类型代理的数据存储时,DirectStore 作为组合框的源,我完全无法设置自动完成,即使在确保设置了 mode: 'remote' 后也是如此。
使用 Firebug、Chromium 开发工具等查看请求后,我确实看到它正在向 API 路由器发出请求,因此正在发出请求,但问题是,它不知道它是应该将我在自动完成框中输入的文本附加到发送回服务器的 JSON 中。
所以我想我的最终问题是,是否有任何人都知道的方法可以确保即使使用 DirectStore,也可以发送正确的数据,以便我可以在服务器后端进行一些排序或数据定位?谢谢:D
Aloha!
I'm busy working on a project and I've come across a problem: when using a data store with the proxy of type Direct, so, a DirectStore, as the source for a combobox, I am entirely unable to set up autocompletion, even after ensuring that mode: 'remote' is set.
After looking at the requests with Firebug, Chromium dev tools, and what have you, I do see that it is making a request back to the API router so the request is being made, but the problem is, it doesn't know that it's supposed to attach the text that I've typed into the autocomplete box to the JSON that is being sent back to the server.
So I guess my ultimate question is, is there any way that anyone here knows of so as to ensure that, even with a DirectStore, the proper data is sent so I can do some sorting or data targeting on the server backend? Thanks :D
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
使用 ExtJS 4.x,在处理查询时,您有两个可用的配置选项...
queryMode
和
queryParam
第一个配置选项可以是
remote
(无论如何默认为此)或local
,第二个选项允许您定义该名称参数为使用远程查询方式时。此外,您还可以将queryMode
设置为false
或0
或空字符串,这将导致 no 参数发送到服务器。With ExtJS 4.x you have two config options available when dealing with querying...
queryMode
and
queryParam
The first config option can be either
remote
(defaults to this anyway) orlocal
and the second option lets you define what the name of the parameter is when using a remote query mode. Additionally, you can also setqueryMode
tofalse
or0
or an empty string, and this will cause no parameter to be sent to the server.