Page 1 of 1

Change table sorting

Posted: 2019-01-10 21:22
by Alisson
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.

Re: Change table sorting

Posted: 2019-01-10 21:35
by pbottcher
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?

Re: Change table sorting

Posted: 2019-01-10 22:06
by Alisson
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).

Re: Change table sorting

Posted: 2019-01-10 22:24
by pbottcher
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 3496 times

Re: Change table sorting

Posted: 2019-01-10 22:51
by Alisson
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.

:(