v16 sort editor

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

v16 sort editor

4D Tech mailing list
Hi all.
Up until v15, the list of fields displayed in the Order By editor and in the Property List > Expression editor, for a listbox, display in the order of creation rather than alphabetically.
This behaviour makes it a pain to find a field in a large table.

The new-ish Query editor displays the fields alphabetically which is sooooo much better.

I was hoping that v16 would have fixed the sort editor but I can see that it hasn't changed (just opened v16.1 for the first time).

Am I missing something that will make those field lists sort alphabetically?
Am I the only one that would like the list of fields to be sorted?
Cheers, Keith
**********************************************************************
4D Internet Users Group (4D iNUG)
FAQ:  http://lists.4d.com/faqnug.html
Archive:  http://lists.4d.com/archives.html
Options: http://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:[hidden email]
**********************************************************************
Reply | Threaded
Open this post in threaded view
|

RE: v16 sort editor

4D Tech mailing list
Hi Keith,

I think the only reason the Query Editor has the fields in alphabetical order is because of the recent redesign.

I am not sure if there is any plan to redesign the Sort Editor; it certainly isn't listed as a bug.

So, to work with the current behavior, I think you can use the SET FIELD TITLES command:
{
SET FIELD TITLES lets you mask, rename, and reorder the fields of the table passed in aTable or aSubtable when they appear in standard 4D dialog boxes, such as the Query editor, within the Application environment (more specifically, when the editors are called using 4D language commands).
}
http://livedoc.4d.com/4Dv15.4/help/Command/en/page602.html

There is some code available on the Forums (posted by Arnaud De Montard) that will automatically sort the available fields for you using the SET FIELD TITLES command, this could be called on startup:
http://forums.4d.fr/Post/EN/11766178/1/11766179#11766294
http://forums.4d.fr/Code4DText/EN/2/1/11766294/771132927


C_LONGINT($table_l;$field_l;$nbOfTables_l;$nbOfFields_l)
$nbOfTables_l:=Count tables
ARRAY LONGINT($number_al;$nbOfTables_l)
ARRAY TEXT($name_at;$nbOfTables_l)
For($table_l;1;$nbOfTables_l)
$number_al{$table_l}:=$table_l
$name_at{$table_l}:=Table name($table_l)
End for
SORT ARRAY($name_at;$number_al;>)
SET TABLE TITLES($name_at;$number_al)
For($table_l;1;$nbOfTables_l)
$nbOfFields_l:=Count fields($table_l)
ARRAY LONGINT($number_al;$nbOfFields_l)
ARRAY TEXT($name_at;$nbOfFields_l)
For($field_l;1;$nbOfFields_l)
$number_al{$field_l}:=$field_l
$name_at{$field_l}:=Field name($table_l;$field_l)
End for
SORT ARRAY($name_at;$number_al;>)
SET FIELD TITLES(Table($table_l)->;$name_at;$number_al)
End for

Kind Regards,

Tim PENNER




-----Original Message-----
From: 4D_Tech [mailto:[hidden email]] On Behalf Of Keith Goebel via 4D_Tech
Sent: Wednesday, June 14, 2017 3:28 PM
To: 4D Tech Mailing List Technical
Cc: Keith Goebel
Subject: v16 sort editor

Hi all.
Up until v15, the list of fields displayed in the Order By editor and in the Property List > Expression editor, for a listbox, display in the order of creation rather than alphabetically.
This behaviour makes it a pain to find a field in a large table.

The new-ish Query editor displays the fields alphabetically which is sooooo much better.

I was hoping that v16 would have fixed the sort editor but I can see that it hasn't changed (just opened v16.1 for the first time).

Am I missing something that will make those field lists sort alphabetically?
Am I the only one that would like the list of fields to be sorted?
Cheers, Keith
**********************************************************************
4D Internet Users Group (4D iNUG)
FAQ:  http://lists.4d.com/faqnug.html
Archive:  http://lists.4d.com/archives.html
Options: http://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:[hidden email]
**********************************************************************
**********************************************************************
4D Internet Users Group (4D iNUG)
FAQ:  http://lists.4d.com/faqnug.html
Archive:  http://lists.4d.com/archives.html
Options: http://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:[hidden email]
**********************************************************************
Reply | Threaded
Open this post in threaded view
|

RE: v16 sort editor

4D Tech mailing list
In reply to this post by 4D Tech mailing list
Timothy, thanks for your reply.
I presume it wouldn’t take much to add a "sort fields” command to the existing sort and expression editor, but what do I know…
I will try your suggestion.
Thanks, Keith

> I think the only reason the Query Editor has the fields in alphabetical order is because of the recent redesign.
> I am not sure if there is any plan to redesign the Sort Editor; it certainly isn't listed as a bug.
> So, to work with the current behavior, I think you can use the SET FIELD TITLES command:…
**********************************************************************
4D Internet Users Group (4D iNUG)
FAQ:  http://lists.4d.com/faqnug.html
Archive:  http://lists.4d.com/archives.html
Options: http://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:[hidden email]
**********************************************************************