0

How to make our grid pagination update automatically when page loads:

asked 2022-04-20 18:48:39 +0800

softteam gravatar image softteam
130 1 8

Hi,

I am using a own pagination in a grid component and I would like to know how can I make the pageSize update automatically based on the number of records being displayed on the screen? Because until I perfom an action in the screen the pageSize isn’t updated. The code I am using is the following:

Zul:

image description

image description

Java controller:

image description

Here I have the method that is executed with the AfterCompose event, where I indicate the pageSize that the pagination will have, which will be the one that the grid has, by default 20.

When we load the page it shows us the pageSize with 20 records, however, if we count the records we see that there are 19.

image description

image description

Instead, if you change the page it is automatically updated to the number of records that fit on the screen:

image description

image description

delete flag offensive retag edit

1 Answer

Sort by » oldest newest most voted
0

answered 2022-04-25 17:08:05 +0800

hawk gravatar image hawk
3048 1 5
http://hawkphoenix.blogsp... ZK Team

updated 2022-05-16 09:13:19 +0800

I saw you have specified autopaging="true" and vflex="true", Grid will determine its page size automatically according to available height. Hence, you can't change the page size by setPageSize().

You mentioned:

how can I make the pageSize update automatically based on the number of records being displayed on the screen?

As I understand, what you want is exactly what autopaging="true" does. You need to change the height to change the number of records to display.

link publish delete flag offensive edit
Your answer
Please start posting your answer anonymously - your answer will be saved within the current session and published after you log in or create a new account. Please try to give a substantial answer, for discussions, please use comments and please do remember to vote (after you log in)!

[hide preview]

Question tools

Follow

RSS

Stats

Asked: 2022-04-20 18:48:39 +0800

Seen: 13 times

Last updated: May 16

Support Options
  • Email Support
  • Training
  • Consulting
  • Outsourcing
Learn More