<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
		<id>http://greggsmith.net/wiki/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Jader</id>
		<title>SDU - User contributions [en]</title>
		<link rel="self" type="application/atom+xml" href="http://greggsmith.net/wiki/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Jader"/>
		<link rel="alternate" type="text/html" href="http://greggsmith.net/wiki/index.php?title=Special:Contributions/Jader"/>
		<updated>2026-04-17T15:33:31Z</updated>
		<subtitle>User contributions</subtitle>
		<generator>MediaWiki 1.26.1</generator>

	<entry>
		<id>http://greggsmith.net/wiki/index.php?title=Additional_Sorting_on_List_Panel&amp;diff=4069</id>
		<title>Additional Sorting on List Panel</title>
		<link rel="alternate" type="text/html" href="http://greggsmith.net/wiki/index.php?title=Additional_Sorting_on_List_Panel&amp;diff=4069"/>
				<updated>2010-05-27T20:06:03Z</updated>
		
		<summary type="html">&lt;p&gt;Jader: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__&lt;br /&gt;
[[Category:Customizations]]&lt;br /&gt;
[[Category:r11]]&lt;br /&gt;
{{Global Header}}&lt;br /&gt;
{{Global Announcement}}&lt;br /&gt;
&lt;br /&gt;
== Overview ==&lt;br /&gt;
This article elaborates on how to sort on additional columns in a list panel (in casu list_in.htmpl).&lt;br /&gt;
&lt;br /&gt;
== Basic sorting ==&lt;br /&gt;
The basic principle to sort on additional columns is to add it to the SORT statement of a .mod file&lt;br /&gt;
&lt;br /&gt;
For example to sort on assignee, code:&lt;br /&gt;
&lt;br /&gt;
 OBJECT cr {&lt;br /&gt;
  FACTORY in {&lt;br /&gt;
    STANDARD_LISTS {&lt;br /&gt;
      SORT_BY &amp;quot;open_date DESC, id DESC, status, priority DESC, ref_num, assignee&amp;quot;;&lt;br /&gt;
           MLIST OFF;&lt;br /&gt;
           RLIST OFF;&lt;br /&gt;
            };&lt;br /&gt;
      };&lt;br /&gt;
 };&lt;br /&gt;
&lt;br /&gt;
Doing this, you will now notice that the list orders by Assignee UUID, and not the Assignee Name.&lt;br /&gt;
This can be solved by including the Assignee Combo_Name in the list panel, and sorting on the Combo_Name instead.&lt;br /&gt;
&lt;br /&gt;
The code now looks like:&lt;br /&gt;
&lt;br /&gt;
 OBJECT cr {&lt;br /&gt;
  FACTORY in {&lt;br /&gt;
    STANDARD_LISTS {&lt;br /&gt;
      SORT_BY &amp;quot;open_date DESC, id DESC, status, priority DESC, ref_num, assignee.combo_name&amp;quot;;&lt;br /&gt;
           MLIST OFF;&lt;br /&gt;
           RLIST OFF;&lt;br /&gt;
          }; &lt;br /&gt;
     };&lt;br /&gt;
 };&lt;br /&gt;
&lt;br /&gt;
Obviously you can do the same for all fields where combo_name is available (eg. group).&lt;br /&gt;
&lt;br /&gt;
However, if you would like to sort on Category Symbol, then we don't have an equivalent to combo_name.&lt;br /&gt;
Therefor you should first create on. &lt;br /&gt;
&lt;br /&gt;
Add the following to your .mod file to create this (I called it catName here):&lt;br /&gt;
&lt;br /&gt;
 OBJECT pcat {&lt;br /&gt;
    ATTRIBUTES Prob_Category {&lt;br /&gt;
    	catName DERIVED(sym);&lt;br /&gt;
    } ;&lt;br /&gt;
 } ;&lt;br /&gt;
&lt;br /&gt;
And again change your Sort code to the following: &lt;br /&gt;
&lt;br /&gt;
 OBJECT cr {&lt;br /&gt;
  FACTORY in {&lt;br /&gt;
    STANDARD_LISTS {&lt;br /&gt;
      SORT_BY &amp;quot;open_date DESC, id DESC, status, priority DESC, ref_num, assignee.combo_name, group.combo_name, category.catName&amp;quot;;&lt;br /&gt;
           MLIST OFF;&lt;br /&gt;
           RLIST OFF;&lt;br /&gt;
           };&lt;br /&gt;
      };&lt;br /&gt;
 };&lt;br /&gt;
&lt;br /&gt;
== Edit In List ==&lt;br /&gt;
Because some fields (such as assignee) or now no longer in the list, the Edit-In-List function will fail.&lt;br /&gt;
What you can do is add these fields back to the list, but make them invisible as to not clutter the list with redundant information.&lt;br /&gt;
Good practice is to add them on the second line.&lt;br /&gt;
&lt;br /&gt;
As to make this field invisible, you must attach a style to it.&lt;br /&gt;
Be aware that you can only add a style to a field that is defined as a link. So the assignee field must be set to link.&lt;br /&gt;
&lt;br /&gt;
Then add the following code to your list panel:&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;pdm_macro name=lsWrite text=&amp;quot;HideMe = 'listHide';&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;PDM_MACRO NAME=lsCol hdr=Assignee attr=assignee.combo_name nowrap=yes justify=left&amp;gt;&lt;br /&gt;
	&lt;br /&gt;
 &amp;lt;PDM_MACRO NAME=lsCol attr=assignee link=yes justify=left style=HideMe&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And define your style in the Analyst StyleSheet:&lt;br /&gt;
&lt;br /&gt;
 A.listHide&lt;br /&gt;
 {&lt;br /&gt;
 VISIBILITY: hidden;&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
== Compatibility ==&lt;br /&gt;
This all works fine in FireFox, but what a surprise IE doesn't like it.&lt;br /&gt;
What happens is that IE tries to put the focus on the last link field, which is now hidden. Hence it fails.&lt;br /&gt;
&lt;br /&gt;
Therefore I added the ref_num again at the end of the second line.&lt;br /&gt;
OK, I now have the ref_num twice (see screenshot) but at least it works with IE also.&lt;br /&gt;
&lt;br /&gt;
[[Image:Example.jpg]]&lt;br /&gt;
&lt;br /&gt;
== Final Note ==&lt;br /&gt;
It may happen that the newly created sort will not be available until you hit the Search button.&lt;br /&gt;
This is because your system is initially displaying list_cr instead of list_in or list_pr. &lt;br /&gt;
In that case you will need to apply some fixes from CA.&lt;/div&gt;</summary>
		<author><name>Jader</name></author>	</entry>

	</feed>