Hello Thomas! Thank you for your time and efforts to provide us with this awesome tutorial. I finished your tutorial and works perfectly fine, but I was looking to fine-tune the pagination feature.
Do you know how I can add Page numbers like 1, 2, 3, 4, 5 and move according to the active page?
Also, the text 1-25 is not showing number 1 and is only showing 25. I checked and is the same as your tutorial. Am I doing something wrong?
And in the last page, when shows like 2 results instead of 25 in total, still says 25 out of… basically is not counting the remaining results properly.
Are you building an aircraft management app? I built one for my group share ages ago, let me know if you need any pointers for stuff like maintenance / currency tracking!
I have never really touched the table element, but here’s some ideas:
I don’t understand why you have Table Flight’s From - Table Flight’s From. That’s always going to be zero so would be redundant.
Because of the above, simplify your formula to Showing Dropdown’s value out of Search for Flights:count
Now, to solve your problem:
Dropdown’s value < - range - > Search for Flights:count - Table Flight’s From : min
Dropdown’s value is the number per page.
Search for Flights:count - Table Flight’s From is the number of remaining flights.
We put these two values in a range, and take the smallest value which is the number of flights remaining.
So, for Dropdown’s value < - range - > Search for Flights:count - Table Flight’s From : min
Dropdown’s value (15) < - range - > Search for Flights:count (17) - Table Flight’s From (15) : min
That’s 15 < - range - > 2 : min, and of course two is smaller so that’s the result of the expression, and that’s the number of results being displayed. Best of luck!
For the total number of results (and the number of results being displayed), both numbers are displaying 1 number over the amount for each one. Even in the Table component it has this same issue.
For example instead of 10 - 15, it’s showing 11 - 16
I corrected this by amending the formula on the upper value to have a minus 1. The bit I can’t figure is how to stop banding to stop it going higher than the number records
In case anybody stumbles across this, I realised a way to do this. I used the <-Min-> operator on the 2nd part - comparing the output from each stage with the total number of rows.