|Default - unsorted - navigation dropdown menu.|
My fellow Siebel scholar and co-worker Duncan Ford has put together this nice example, so all kudos go to him in full. Without further ado, here is the code for a custom physical renderer accomplishing the sort (see below for a description).
|Click to enlarge.|
In the renderer's BindData() function we use the jQuery sort() method to - well - sort the elements (i.e. options) in the dropdown lists, identified by their parent's id (e.g. j_s_vctrl_div_tabScreen).
This is why you find the NASort() function in the above code which specifies how to compare two values and returns 1 or -1.
The sorted option list is then appended to its parent again, effectively replacing the unsorted list.
After saving the file as usual to the custom scripts folder, we have to register it in the Manifest Files view of the Administration - Application screen.
The final step is to associate the file with the NAVIGATION_TAB object in the Manifest Administration view. To do so, we copy the existing entry and add our custom file to the copy, maybe using the pre-defined "Desktop" expression.
After a re-login, we can marvel at sorted dropdowns, what a soothing sight:
|Sorted navigation dropdown list.|
A simple extension to the predefined navigation renderer allows us to sort things out, in a good way.
have a nice day