在分页事件上重新加载 GXT 网格
我有 Ext-GWT Grid,它使用 PagingModelMemoryProxy、BasePagingLoader 和 PagingToolbar。一切都运行良好,直到出现一项要求。
当我单击“下一步”、“上一个”、“最后一个”、“第一个”或“刷新”时,我希望网格从服务器重新加载数据。我所做的是重写分页工具栏方法并捕获分页事件。现在,当用户单击“下一步”时,它首先执行分页事件,然后服务器重新加载数据。当客户端从服务器接收数据时,它告诉网格重新加载它。
这里一切工作正常,但正如您所看到的,Load 事件被触发了两次。首先用于分页事件,以及新数据从服务器到达时的其他事件。
现在我的问题是我应该怎么做才能解决这个要求?我知道 RpcProxy 可以为我工作,但我无法更改服务器方法,而且我没有用于服务器调用的正常异步回调。谁能建议我应该做什么才能仅与 PagingModelMemoryProxy、BasePagingLoader 一起使用?
I am having Ext-GWT Grid which is using PagingModelMemoryProxy, BasePagingLoader and PagingToolbar. All is working well until one requirement.
I want my grid to reload the data from server when i click on Next, Previous, Last, First or Refresh. What i did is overridden the pagingtoolbar methods and capture the pagination events. Now when user clicks on next it first do pagination event and then server to reload data. When client receives data from server it tell grid to reload it.
Here everything is working fine, but as you can see the Load event is getting fired twice. First for pagination event and other when new data arrived from server.
Now my question is what should i do to resolve this requirement? I know RpcProxy can work for me but i cant change the server methods and also i dont have normal asynccallback for server calls. Can any one suggest what should i do which will work with PagingModelMemoryProxy, BasePagingLoader only?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
试试这个:
此外,要停止传入事件,您可以调用:
这将聚合
cancelBubble()
和stopPropagation()
。Try this:
In addition, to stop incoming events you can call:
which will aggregate both
cancelBubble()
andstopPropagation()
.