GXT 中的动态自动建议组合框
在过去的 5 个月里,我们一直在制作 GWT 原型并建立基础设施。我们将 GXT 用于具有 MVP 和命令模式实现的小部件。然而,我们目前正在寻求通过实时数据库的自动建议来对 ComboBox 进行峰值。我想在 MVP 和命令模式实现的框架中做到这一点。那里有人有任何想法如何去做这件事吗?
Over the past 5 months we have been prototyping GWT and setting up the infrastructure. WE are using GXT for the widgets with MVP and Command Pattern implementations. However, we are currently looking to do a spike on a ComboBox with autosuggest from a live Database. I would like to do this in the framework of the MVP and Command pattern implementations. Any one out there have any ideas how to go about doing this?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
我使用基于命令模式建模的通用 DispatchDataProxy 解决了这个问题。感谢您提供的链接,但 GXT 文档还有很多不足之处,尽管该框架确实非常好而且很酷。
我将在这里发布代码 `public class DispatchDataProxy Implements DataProxy> {
}`
希望有用。也会感谢一些评论
I solved that using a generic DispatchDataProxy modelled over the Command Pattern. Thanks for the link, but GXT documentation leaves a lot to be desired, though the framework is really nice and cool.
I will post the code here `public class DispatchDataProxy implements DataProxy> {
}`
Hope its useful. Will appreciate some comments as well
你看过这里吗?
http://www.sencha.com/examples-2/explorer.html#advancedcombobox
他们展示了类似的东西。 GXT 的问题是你最好使用他们的 DataProxy,因为你需要设置一个 ModelData 实例。
Have you looked here?
http://www.sencha.com/examples-2/explorer.html#advancedcombobox
They show something similar. The issue with GXT is you are better off using their DataProxy because you need to set a ModelData instance.
我找到了简单组合框的解决方案,覆盖 getValue 方法:
现在,当您添加到组合框默认值(未在商店中定义)时, getValue 方法返回该值 - 非空。
I found solution for simple combo box, override getValue method:
Now when you add to combo box default value (not defined in store) method getValue returns this value - not null.