Page 1 of 1

Select last page at start

Posted: 2013-02-02 10:53
by Sergio
Uhm this is what i need:
Supposing to have 100 records, and setting to have 10 rows per page in appgini. Normally when you show the table you will see first 10 records and you will be on page 1 of 10.
I would like that when you open the table, you'll see last 10 records in page 10 of 10.....any idea of how can i get this??
I mean i would like to choose a specific number page at first view. I suppose i need to chance some code somewhere but no idea where and how :)
Thx for any help.

Re: Select last page at start

Posted: 2013-02-02 19:27
by KSan
How about presenting your table in reverse sorted order based on record creation date/time stamp? You can add a field to your table to cable the record creation date/time stamp and then set the view to sort based on this. The latest 10 will always be presented first then. Hope this helps.

Re: Select last page at start

Posted: 2013-02-02 23:06
by Sergio
Thx but i need to keep the order by id, i mean the order is right and is how it should be, i just need to show the last page at start instead of first page :) with the same order as usual

Re: Select last page at start

Posted: 2013-02-03 07:04
by Johnk
This should do it;

Go to the "Table View Settings" of your table and tick the box marked "Descendingly", It's on the right, just below the dropdown for "Quick Search Box".

This will allow your key field (ID) to display last to first. Don't forget to refresh when you run your script.

Re: Select last page at start

Posted: 2013-02-03 09:35
by Johnk
Whoops. I slipped up and didn't discover it until the allowable PhpBB edit period had passed.

1. Go to the "Table View Settings" of your table.
2. Select the field to sort by from the drop down "Default Sort By"
3. Tick the box marked "Descendingly" to the right.

Re: Select last page at start

Posted: 2013-02-03 14:14
by Sergio
thx again, but still it's not what i need :)
i dont have to change the order, i have only to change the first page showed. In the example, if i have 100 record with the id from 1 to 100....with 10 records per page....i would like to show page 10 of 10 with record from 91 to 100. The order must be the same, so first row record 91, second 92 etc etc. The page showed should be always the last page in the db, so i can see only the last records inserted, with the rate of 10 per page. (10 is an example...could be whatever you want)
Thx anyway for answers i appreciate :)

Re: Select last page at start

Posted: 2013-02-05 09:03
by Johnk
I'm Sorry, but it sounds a bit odd. In your scenario, the top record would be the tenth last record entered. That could be very confusing to some people. Wouldn't you want to see the last record entered, followed by the second last etc?

Just curious.

Re: Select last page at start

Posted: 2013-02-05 16:44
by KSan
If I understand this correctly what Sergio needs to do is similar to bringing up a table and then clicking Next until you reach the end of the table. Is that right Sergio? Thanks for the clarification.

Re: Select last page at start

Posted: 2013-02-06 17:28
by Sergio
KSan wrote:If I understand this correctly what Sergio needs to do is similar to bringing up a table and then clicking Next until you reach the end of the table. Is that right Sergio? Thanks for the clarification.
Perfect!!! Exactly what i need ^^

Re: Select last page at start

Posted: 2013-02-07 10:28
by a.gneady
You could link to "tablename_view.php?FirstRecord=1000" (where tablename is the name of the concerned table) ... replace 1000 in the link with any number that you know is sufficiently higher than the number of records in that table. Your AppGini application would then automatically display the last page.