Select last page at start

If you're a new user of AppGini, feel free to ask general usage questions, or look for answers here.
Post Reply
Sergio
Posts: 21
Joined: 2013-01-08 19:22

Select last page at start

Post by Sergio » 2013-02-02 10:53

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.

KSan
AppGini Super Hero
AppGini Super Hero
Posts: 252
Joined: 2013-01-08 20:17

Re: Select last page at start

Post by KSan » 2013-02-02 19:27

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.

Sergio
Posts: 21
Joined: 2013-01-08 19:22

Re: Select last page at start

Post by Sergio » 2013-02-02 23:06

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

Johnk
AppGini Super Hero
AppGini Super Hero
Posts: 68
Joined: 2013-01-09 03:47
Location: Cairns, Australia

Re: Select last page at start

Post by Johnk » 2013-02-03 07:04

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.

Johnk
AppGini Super Hero
AppGini Super Hero
Posts: 68
Joined: 2013-01-09 03:47
Location: Cairns, Australia

Re: Select last page at start

Post by Johnk » 2013-02-03 09:35

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.

Sergio
Posts: 21
Joined: 2013-01-08 19:22

Re: Select last page at start

Post by Sergio » 2013-02-03 14:14

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

Johnk
AppGini Super Hero
AppGini Super Hero
Posts: 68
Joined: 2013-01-09 03:47
Location: Cairns, Australia

Re: Select last page at start

Post by Johnk » 2013-02-05 09:03

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.

KSan
AppGini Super Hero
AppGini Super Hero
Posts: 252
Joined: 2013-01-08 20:17

Re: Select last page at start

Post by KSan » 2013-02-05 16:44

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.

Sergio
Posts: 21
Joined: 2013-01-08 19:22

Re: Select last page at start

Post by Sergio » 2013-02-06 17:28

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 ^^

User avatar
a.gneady
Site Admin
Posts: 1281
Joined: 2012-09-27 14:46
Contact:

Re: Select last page at start

Post by a.gneady » 2013-02-07 10:28

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.
:idea: AppGini plugins to add more power to your apps:
  • DataTalk is an innovative AppGini plugin based on ChatGPT that allows you to interact with your AppGini database using natural language questions, without writing any SQL. Check the demo video
  • Mass Update plugin: Update multiple records at once and improve your workflow efficiency.
  • Check our other plugins and get a generous discount of up to 30% when buying 2 or more plugins.

Post Reply