Ultimate Portal Sorting Updated
Two of the most requested features for portals are likely horizontal scrolling and being able to sort individual columns. The former is something far out of your control, yet the later is something you can accomplish with a bit of creativity.
In this video, you'll learn every detail you need to know in order to sort a portal on any column, in either direction, using any field type and supporting multiple languages! This truly is Ultimate Portal Sorting. The technique only requires one additional field for each table with data presented in a portal, and uses one script for all portals across the whole of your solution. If sorting portals is what you desire then this video will give you what you need!
Comments
Sorting by number and letters
If you ever come in the situation where you have to sort records based on a combination of numbers and letters, you have to make a slight adjustment to the custom function "StringToNumber" that is used in this solution.
If you sort records by the "fmp" method, but your records contain a combination from numbers and letters, e.g.;
5MainCOMP001
5MainCOMP002
UpperCOMP002
5BaseCOMP001
3BaseCOMP002
UpperCOMP001
you can get some weird sorting results that you don't experience as "logical". The only thing you have to do, is to put a number string BEHIND the "fmp"-string, like this;
_sort_string_fmp = " ¢£¥’\†!\"#$%&'()*+,-./:;<>?@[\]^_`{|}~aáà âÅåÄäÆæbcÇçdeÉéèêëfÆ’ghiÃìîïjklmnÑñoóòôÖöpqrstuúùûÜüvwxyÿz0123456789"
Now you can sort on both number and letters in alphabetical order. Offcourse this will work on the other strings, like UNIX and Directory.