Similar to the global pui["gridSort"] function configuration option. The sort function can be used to customize the client side grid column sort. Unlike the pui["gridSort"] function, function is only defined for the screen level rather than global. 

When sorting your grid, the sort function will be called many times to compare elements.  You can think of your sort function as a "compare" function. It tells the sort routine which rows should be placed before other rows in the grid.

The following variables are passed to this function:

Return Value:

The function should return a number that tells the grid which row should be placed before the other:


Examples:

The function code should go directly into the "sort function" property. For example, if the column being sorted is numeric, you could code:

return value2 - value1;

If the "sort function" were to be applied via applyProperty, this would be the syntax:

applyProperty('Grid1', 'sort function', 'return value2 - value1;')



Available in Version 6, Fix Pack 1.0 and later