The variable pui.gridSort can be used to customize the client side grid column sort by defining a sort function.
The following parameters are passed to this function:
- value1 = first field value to compare.
- value2 = second field value to compare.
- fieldName = name of the field that the grid is sorted by. (Available in Version 5, Fix Pack 6.0 and later)
- isDescending = true if sorting in descending sequence, false otherwise. (Available in 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 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 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
- Some of the properties in the field info are:
- multiFields= When a multiple-column sort runs, this is an array of information about each column included in the sort. The first preferred 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 a single column. (Available in Version 6, Fix Packs later than 2.1)
- Properties of each object are the same as described above:
- fieldName
- fieldFormat
- fieldDateFormat
- value1
- value2
- Properties of each object are the same as described above:
Example:
pui.gridSort = function(value1, value2, fieldName, isDescending, fieldDateFormat, fieldInfo) { if (value1 > value2) return -1; else return 1; }
This function could be used to control the order numerals and characters are sorted.
Where do you save this configuration option? Here