Change table sorting

Please report bugs and any annoyances here. Kindly include all possible details: steps to reproduce, expected result, actual result, screenshots, ... etc.
Post Reply
Alisson
Veteran Member
Posts: 81
Joined: 2017-02-25 20:32

Change table sorting

Post by Alisson » 2019-01-10 21:22

In my table, rows are sorted by the date, everything was working ok until the last day of 2018, from 01/01/2019 on, when new records are added to the table they appear at the last position in the table instead of the first. So the sorting is working for dates until 2018 only. How can I fix that without having to generate the code again?.
I've tried changing this:

Code: Select all

	$x->DefaultSortField = '`vehicles`.`date`';
	$x->DefaultSortDirection = 'asc';
in tablename_view.php but It didn't work

Thanks.

pbottcher
AppGini Super Hero
AppGini Super Hero
Posts: 1635
Joined: 2018-04-01 10:12

Re: Change table sorting

Post by pbottcher » 2019-01-10 21:35

Hi,

what is the dateformat -> order that you have set in AppGini for your project (App)? Maybe that is the source.
Did you have only records for 2018 yet in your table?
Any help offered comes with the best of intentions. Use it at your own risk. In any case, please make a backup of your existing environment before applying any changes.

Alisson
Veteran Member
Posts: 81
Joined: 2017-02-25 20:32

Re: Change table sorting

Post by Alisson » 2019-01-10 22:06

The appgini project is set to sort by the date column.
I have records for 2018 and 2019, but in the table I see them sorted by date desc
12/31/2018
12/30/2018
12/29/2019

But dates from 2019 are been added in the end of the table like this
12/31/2018
12/30/2018
12/29/2019
...
05/03/2018
01/11/2019
01/08/2019
01/05/2019
Only after I click twice in the DATE table header than they show in the correct order.

I also tried to change the sort paramenter to:

Code: Select all

$x->DefaultSortField = '20';
But also didn't work (20 is the column number).

pbottcher
AppGini Super Hero
AppGini Super Hero
Posts: 1635
Joined: 2018-04-01 10:12

Re: Change table sorting

Post by pbottcher » 2019-01-10 22:24

Hi,

it looks like you have a sort order of month-day-year.

Can you check in AppGini
date.gif
date.gif (10.84 KiB) Viewed 3486 times
Any help offered comes with the best of intentions. Use it at your own risk. In any case, please make a backup of your existing environment before applying any changes.

Alisson
Veteran Member
Posts: 81
Joined: 2017-02-25 20:32

Re: Change table sorting

Post by Alisson » 2019-01-10 22:51

Thank for the help pböttcher.

I don't have the axp file anymore, so I was trying to modify the files, guess I have to create the project again to try it..
Thanks. I'll see what I can do.

:(

Post Reply