简体   繁体   English

GWT CELLTABLE SimplePager:在SimplePager中出现的first,last,next,prev按钮上的事件处理?

[英]GWT CELLTABLE SimplePager : Event handling on first,last,next,prev button present in SimplePager?

How to handle event on SimplePager? 如何在SimplePager上处理事件? Event handling on first,last,next,prev button present in SimplePager? 在SimplePager中出现的第一个,最后一个,下一个,上一个按钮的事件处理? I am using CellTable gwt 2.3.0 我正在使用CellTable gwt 2.3.0

Right now I am parsing xml in which 100 records are present. 现在我正在解析xml,其中有100条记录。 xml coming from server. xml来自服务器。

@ time I am showing 100 reocrd per table_page ie pageSize(100); @ time我每个table_page显示100个reocrd,即pageSize(100);

Whenever I will click next button then I will made server request for getting next 1OO records same way for every button.. 每当我点击下一个按钮,我就会发出服务器请求,为每个按钮以相同的方式获取下一个1OO记录。

How to Handle event on SimplePager ? 如何在SimplePager上处理事件?

Any help or guidance in this matter would be appreciated 任何有关此事的帮助或指导将不胜感激

in fact, you don't need to handle event on pager, this is your data provider which takes care of loading. 实际上,您不需要在寻呼机上处理事件,这是您负责加载的数据提供者。

Read the javadoc on simple pager : http://google-web-toolkit.googlecode.com/svn/javadoc/2.3/com/google/gwt/user/cellview/client/SimplePager.html 阅读简单寻呼机上的javadoc: http//google-web-toolkit.googlecode.com/svn/javadoc/2.3/com/google/gwt/user/cellview/client/SimplePager.html

the simple pager add buttons and call the data provider. 简单的寻呼机添加按钮并调用数据提供者。 It gives to the data provider all informations you need to load good records (offset, size...) 它为数据提供者提供了加载良好记录所需的所有信息(偏移量,大小......)

EDIT: create a new subclass of AbstractDataProvider ( javadoc ) which implements the method onRangeChanged . 编辑:创建AbstractDataProviderjavadoc )的新子类,该子类实现onRangeChanged方法。 In that method you get a HasData object which contains all information you need to call an rpc service (offset of visible items). 在该方法中,您将获得一个HasData对象,其中包含调用rpc服务所需的所有信息(可见项的偏移量)。

When you have received response of your service, call the updateRowCount and updateRowData method. 收到服务响应后,请调用updateRowCountupdateRowData方法。 This will update the display and the pager. 这将更新显示和寻呼机。

You don't need to register handler for pager buttons, only defines DataProvider and all will run like a charm. 您不需要为寻呼机按钮注册处理程序,只定义DataProvider,并且所有操作都将像魅力一样运行。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM