Page tree
Skip to end of metadata
Go to start of metadata

The variable pui.gridSort can be used to customize the client-side grid column sort by defining a sort function.

Provided Parameters

The following values are provided to this function as passed parameters:

  • value1 = first field value to compare.
  • value2 = second field value to compare.
  • fieldName = name of the field that the grid is sorted by. [Available Added in Profound UI Version 5, Fix Pack 6.0 and later]
  • isDescending = true if sorting in descending sequence, false otherwise. [Available Added in Profound UI Version 5, Fix Pack 6.0 and later]
  • fieldDateFormat = date format of the field that the grid is sorted by, if the field is not a date null will be passed instead. [Available in Profound UI Version 5, Fix Pack 14.0 and later]
  • fieldInfo = formatting information of the field that the grid is sorted by; if the field does not contain any formatting information, a blank object will be passed instead. [Available in Profound UI Version 6 and later] 
    • Some of the properties in the field info are:
      • dataType - the field data type
      • dataLength - data length (only present if the field is a character or a numeric field)
      • formatting - field formatting
  • multiFields = When a multi-column sort executes, multiFields will reference an array of information about each column included in the sort. The preferred first sort column is the first entry in the array; the second preferred column is second; etc. This argument is undefined when the sort is for single-column sort executions. [Available in Profound UI Versions After Version 6, Fix Pack 2.1]
    • Properties of each object are the same as described above:
      • fieldName
      • fieldFormat
      • fieldDateFormat
      • value1
      • value2

Examples:

Compare Values as Strings to Sort Grid
pui.gridSort = function( value1, value2, fieldName, isDescending, fieldDateFormat, fieldInfo ) {
  // Custom comparison code would go here.
  // If value1 is greater than value2, return 1, else, return -1.
  if ( value1 > value2 ) return -1;
  else return 1;
}
Compare Values as Strings to Sort Grid (Alternate Syntax)
pui.gridSort = function( value1, value2, fieldName, isDescending, fieldDateFormat, fieldInfo ) {

  // Custom comparison code would go here.
  // If value1 is greater than value2, return 1, else, return -1.
  return ( ( value1 > value2 ) ? 1 : -1 );
 
}
Where do you save this configuration option?  Here
  • No labels