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.
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.
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:
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.
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.