310
Views
8
Comments
Solved
Ability to show pre-defined number of records per page

Hi newbie here, I want to be able to give a user the option to choose how many records are displayed on a screen, so they can choose 10, 20, 50 per page, what is the best way to accomplish this?  Default would be 10.

2018-10-29 08-31-03
João Marques
 
MVP
Solution

Hi Peter,


What you can do is to have a dropdown with a list / query with the options you want (10, 20, 50) binded to the MaxRecords variable and with the OnChange linked to the screen action you use to refresh the query.

Something like that:


In this way, you allow the user to control the value of the MaxRecords variable through the Dropdown widget.


Regards,
João 

2020-09-15 13-07-23
Kilian Hekhuis
 
MVP

Hi Peter,

The number of records displayed can be specified in the Widget that you're using (e.g. a Table Records). If you use a variable, and change that depending on some user selection, and refresh the Widget (only for Traditional Web App), you should see a different number of records displayed.

UserImage.jpg
Peter Goyal

Thank you, what if its not in traditional but in reactive?  I know how to default it to 10 using the table widget, but I want the user to have the ability to choose 20 or 50.

2018-10-29 08-31-03
João Marques
 
MVP
Solution

Hi Peter,


What you can do is to have a dropdown with a list / query with the options you want (10, 20, 50) binded to the MaxRecords variable and with the OnChange linked to the screen action you use to refresh the query.

Something like that:


In this way, you allow the user to control the value of the MaxRecords variable through the Dropdown widget.


Regards,
João 

2020-09-15 13-07-23
Kilian Hekhuis
 
MVP

Hi João,

The Table Records Widget itself must also have that number of lines, or the pagination will go wrong.

EDIT: Ah, for reactive perhaps not. Must brush up on it...

2018-10-29 08-31-03
João Marques
 
MVP

Hi Killian,


In Reactive, the Line Count property does not exist anymore, at least I don't see it as it appears on Traditional Web.

UserImage.jpg
Peter Goyal

Thank you.  How come you used the OnSearch action versus OnPaginationNavigate for the OnChange Event?

2018-10-29 08-31-03
João Marques
 
MVP

I thought it would make sense to go back to page 1 after you change the number of records but you can implement it as per your use case.

In any case, the point was to have a widget binded to the MaxRecords variable so the user can edit it.

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.