Share via


FieldSortParams Element

The FieldSortParams element returns the sort direction on a list, rendering Asc or Desc based on whether the field has been sorted and on the current default sort direction for the field. Rendering of this field is conditional and depends on the current sorting URL sent in the request to the server.

Syntax

<FieldSortParams>
</FieldSortParams>

Example

The following example creates a default URL for a sort on a list. The FieldSortParams element is used to return the sort direction, which is assigned to the SORTINGFIELDS attribute in the resulting <A> tag.

<Default>
   <HTML><![CDATA[<A ID="diidSort]]></HTML>
   <Property Select='Name'/>
   <HTML><![CDATA[" TITLE=]]></HTML>
   <HTML>"Sort by </HTML>
   <Property Select='DisplayName' HTMLEncode='TRUE'/>
   <HTML><![CDATA[" SORTINGFIELDS="]]></HTML>
   <FieldSortParams/>
   <HTML><![CDATA[" HREF="javascript:" OnClick='javascript:SubmitFormPost("]]></HTML>
   <ScriptQuote NotAddingQuote="TRUE">
      <PageUrl/>
      <HTML><![CDATA[?]]></HTML>
      <FieldSortParams/>
   </ScriptQuote>
   <HTML><![CDATA[");javascript:return false;'>]]></HTML>
   <Property Select='DisplayName' HTMLEncode="TRUE"/>
   <HTML><![CDATA[</A><IMG SRC="]]></HTML>
   <FieldSortImageURL/>
   <HTML><![CDATA[" ALT=]]></HTML>
   <Switch>
      <Expr>
         <GetVar Name='SortDir'/>
      </Expr>
      <Case Value='Asc'>
         <HTML>"Sort Ascending"</HTML>
      </Case>
      <Case Value='Desc'>
         <HTML>"Sort Descending"</HTML>
      </Case>
      <Default>
         <HTML>""</HTML>
      </Default>
   </Switch>
   <HTML><![CDATA[ BORDER=0>]]></HTML>
</Default>