Change number of rows in RG

Is it possible to change the number of rows shown in a Resource Group based on a value of a dropdown box. I have a result set of more than 1000 items and would like to show them paginated in groups of 10, 20, 50, 100, and 200. It is easy to create a dropdown with those values and store the selected value in a custom state element. However I have not been able to populate that value in the RG fixed number of rows field.

Any help is much appreciated

Regards

You can not use a dynamic number for that value of Rows…what you can do is untick the box for fixed number, so that it will in essence be dynamic, which simply means it will have as many rows as necessary based on the datasource and number of results returned.

Then in your datasource, you can use operators for items from and items until in order to show only a certain number of entries based on a dropdown value.

However, if the goal is for pagination, there is much more work to be done to set that up properly.

Thank you for the suggestion. I also need to be able to sort 2 of the columns in the RG. I am using the Repeating Group Sorting plugin and the Toolbox plugin for the pagination. I was hoping that there would be an easy solution to my problem.

Is that working right now or are you asking for help in how to set that up?

I have never heard of it, but do not imagine there is a need for it and instead you can just use built in sort functionality.

Yes, it is possible by setting conditionals like in the example below:

I have this RG with 10 lines pagination, but there is a Dropdown with values 5, 10, 25 inside of a reusable pagination element, and I modify the number of rows in the conditionals:

In my experience though, any number greater than 25-30 will break your RG and it will return nothing. But maybe it was in my particular use case.

Thank you for this suggestion. It worked and I was able to do 50 and 100 records as well. The only thing you also need to adjust is the page height to accommodate for the number of records in the RG.

Forgot to mention, you will need to adjust the RG height as well.

I am now trying to figure out how to change the page height based on the rows selected.

How do you set height and rows properly if there are 3 or 7 or 27 items in RG?

The way I did it was simple. Used the RG properties and calculate the height of the RG number of rows times 36 (my row height is 35 with 1 px extra). In the conditions tab of the RG I created a when clause for each number of rows. In your case that would for 3, 7 and 27 rows. See the image in my previous post (image). Example for 3 rows assuming that the row height is 35 use 3x36=108px for height, for 7 rows that would be 7x36=252px heigh, and for 27 rows that would be 27x36=972px heigh. Note: the “Dropdown Select Records” element is the dropdown with the actual selection options of 10, 20 , 50 and 100 in my case.

Uncheck fixed rows, use :items until Dropdown's value, and size the RG height to match.

1 Like


Doesn’t “Fit height to content” do the job? Just curious because I’ve already experienced some bugs, specially with repeating groups.

Great suggestions. Thank you.

Okay. You can try setting it up so you don’t have to do all that extra work