Lookup Filed - Date and sorting
Lookup Filed - Date and sorting
Hi,
I've a sorting issue.
I've defined a Lookup Field that refers to a date field
As I sort, by <tabel_view.php> the sort is done in order of DAY instead of the complete date field.
Do I miss a "selector field" somewhere?
Ron
I've a sorting issue.
I've defined a Lookup Field that refers to a date field
As I sort, by <tabel_view.php> the sort is done in order of DAY instead of the complete date field.
Do I miss a "selector field" somewhere?
Ron
Re: Lookup Filed - Date and sorting
Hi Ron,
this seems to be like a bug ... AG pulls a date - thus, it should provide a list, that can be sorted as date. It seems to sort it as a string value.
Consider posting as a bug?
Olaf
this seems to be like a bug ... AG pulls a date - thus, it should provide a list, that can be sorted as date. It seems to sort it as a string value.
Consider posting as a bug?
Olaf
Some postings I was involved, you might find useful:
Multi Path Upload (MPU) / dynamic upload folder; SingleEdit - Prevent concurrent edits on records; Field Permissions; Column-Value-Based-Permissions; Custom (error) message; Audit Log; Backup your database; Two Factor Authentication; Block brute force (failed) logins; Add 2nd SAVE CHANGES button
Multi Path Upload (MPU) / dynamic upload folder; SingleEdit - Prevent concurrent edits on records; Field Permissions; Column-Value-Based-Permissions; Custom (error) message; Audit Log; Backup your database; Two Factor Authentication; Block brute force (failed) logins; Add 2nd SAVE CHANGES button
Re: Lookup Filed - Date and sorting
Hi onoehring
Thank you, I'll post it as a possible bug.
Ron
Thank you, I'll post it as a possible bug.
Ron
Re: Lookup Filed - Date and sorting
Hi Ron,
With which version of AppGini are you having this issue? I tried sorting from the table view header and the filter page, on AppGini 23.17 it works as intended without any bug:
-Saymaad
With which version of AppGini are you having this issue? I tried sorting from the table view header and the filter page, on AppGini 23.17 it works as intended without any bug:
-Saymaad
Re: Lookup Filed - Date and sorting
Hi saymaad ,
I'm using 2 versions same results:
V25.15 and V26.10 (the later in develop and stage testing)
Ron
I'm using 2 versions same results:
V25.15 and V26.10 (the later in develop and stage testing)
Ron
Re: Lookup Filed - Date and sorting
Hi Ron,
not sure I see your problem. In the image that you posted, the sorting looks ok. What would you expect?
not sure I see your problem. In the image that you posted, the sorting looks ok. What would you expect?
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.
Re: Lookup Filed - Date and sorting
Hi pbottcher,
Thanks for reaching out.
In my first post I show the result after sorting, click column name.
The results come back sorted by day, so first all the 01 days of ALL months, then the 02 days etc.
The sort is, according to me, bases on a charachter sort instead of a date sort.
Ron
Thanks for reaching out.
In my first post I show the result after sorting, click column name.
The results come back sorted by day, so first all the 01 days of ALL months, then the 02 days etc.
The sort is, according to me, bases on a charachter sort instead of a date sort.
Ron
Re: Lookup Filed - Date and sorting
Hi Ron,
well, could you please post another screenshot showing the problem. I agree with pboetcher, that the first screenshot does not allow us - strangers - to see something wrong
Thanks
Olaf
well, could you please post another screenshot showing the problem. I agree with pboetcher, that the first screenshot does not allow us - strangers - to see something wrong
Olaf
Some postings I was involved, you might find useful:
Multi Path Upload (MPU) / dynamic upload folder; SingleEdit - Prevent concurrent edits on records; Field Permissions; Column-Value-Based-Permissions; Custom (error) message; Audit Log; Backup your database; Two Factor Authentication; Block brute force (failed) logins; Add 2nd SAVE CHANGES button
Multi Path Upload (MPU) / dynamic upload folder; SingleEdit - Prevent concurrent edits on records; Field Permissions; Column-Value-Based-Permissions; Custom (error) message; Audit Log; Backup your database; Two Factor Authentication; Block brute force (failed) logins; Add 2nd SAVE CHANGES button
Re: Lookup Filed - Date and sorting
Olaf,
I know see that I’ve provided a not good example, sorry.
Hereby a better example, column: “Datum aanvraag”
I know see that I’ve provided a not good example, sorry.
Hereby a better example, column: “Datum aanvraag”
Re: Lookup Filed - Date and sorting
HI Ron,
to all in the thread: Ron is showing a lookupfield that contains (correct) an integer value (PK of referenced table) - maybe that's the reason? Is the field actually being shown sorted by the value of the ID field (and it only looks to use that ist' sorted by day first, then month...)?
Can someone reproduce this?
@Ron: What happens, when you click the header in a field that actually is of type date or datetime?
@Ron: Did you set any field specific formating (tab more right)?
Olaf
to all in the thread: Ron is showing a lookupfield that contains (correct) an integer value (PK of referenced table) - maybe that's the reason? Is the field actually being shown sorted by the value of the ID field (and it only looks to use that ist' sorted by day first, then month...)?
Can someone reproduce this?
@Ron: What happens, when you click the header in a field that actually is of type date or datetime?
@Ron: Did you set any field specific formating (tab more right)?
Olaf
Some postings I was involved, you might find useful:
Multi Path Upload (MPU) / dynamic upload folder; SingleEdit - Prevent concurrent edits on records; Field Permissions; Column-Value-Based-Permissions; Custom (error) message; Audit Log; Backup your database; Two Factor Authentication; Block brute force (failed) logins; Add 2nd SAVE CHANGES button
Multi Path Upload (MPU) / dynamic upload folder; SingleEdit - Prevent concurrent edits on records; Field Permissions; Column-Value-Based-Permissions; Custom (error) message; Audit Log; Backup your database; Two Factor Authentication; Block brute force (failed) logins; Add 2nd SAVE CHANGES button
Re: Lookup Filed - Date and sorting
Olaf,
@Ron: What happens, when you click the header in a field that actually is of type date or datetime?
That sorts as expected.
@Ron: Did you set any field specific formating (tab more right)?
No
@Ron: What happens, when you click the header in a field that actually is of type date or datetime?
That sorts as expected.
@Ron: Did you set any field specific formating (tab more right)?
No
Re: Lookup Filed - Date and sorting
Hi Ron,
thanks, that helps.
I agree that this is a bug, as AppGini is using the formated date for sorting, when using the date as lookup, instead of the original date.
What you can try as a workarround is:
Go to the hooks/coachbozoeke.php file an add to the _init function a replacement for the sorting.
You can try to set : $options->SortFields[NUMBEROFYOURFIELD]1="`SOURCETABLE`.`SOURCEFIELD`";
which, if i read the images correctly and your fields did not move positions would result in:
Watch the 1 after the SOURCETABLENAME, this is needed as AppGini adds per lookup to the sourcetable a "counter".
If you have multiple lookups from the coachbozoeke to the aanvragen table, you may need to check the concret "counter".
To do so you may add to the _init function, right at the start:
echo "<pre>";var_dump($options->SortFields);exit;
Call the page and look at the output.
you should see somewhere
Hope I did read the name correctly.
thanks, that helps.
I agree that this is a bug, as AppGini is using the formated date for sorting, when using the date as lookup, instead of the original date.
What you can try as a workarround is:
Go to the hooks/coachbozoeke.php file an add to the _init function a replacement for the sorting.
You can try to set : $options->SortFields[NUMBEROFYOURFIELD]1="`SOURCETABLE`.`SOURCEFIELD`";
which, if i read the images correctly and your fields did not move positions would result in:
Code: Select all
$options->SortFields[7]="`aanvragen1`.`Datum_aangevraagd`";If you have multiple lookups from the coachbozoeke to the aanvragen table, you may need to check the concret "counter".
To do so you may add to the _init function, right at the start:
echo "<pre>";var_dump($options->SortFields);exit;
Call the page and look at the output.
you should see somewhere
use the X from this entry as the counter mentioned above.date_format(`aanvragenX`.`Datum_aangevraagd`,
Hope I did read the name correctly.
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.
Re: Lookup Filed - Date and sorting
Hi pbottcher,
GREAT, ik works.
Ron
Thank you, hopefully there will be a next version/build of AppGini.
GREAT, ik works.
Ron
Thank you, hopefully there will be a next version/build of AppGini.
