|
pfc_columnclick
|
|
Full name
|
pfc_n_cst_lvsrv_sort.pfc_columnclick
|
Access
|
public
|
Extend of
|
long
|
Return value
|
long
|
Prototype
|
event long pfc_columnclick(integer)
|
Name
|
Datatype
|
lnv_columnattrib
|
n_cst_columnattrib
|
event pfc_columnclick;//////////////////////////////////////////////////////////////////////////////
//
// Event: PFC_ColumnClick
//
// Arguments:
// ai_column The column that was clicked
//
// Returns: Integer
// 1 = success
// 0 = No action taken
// -1 = error
//
// Description: Sort the items based on the column whose heading
// was clicked. If already sorted on that column, then
// reverse the sort order.
//
//////////////////////////////////////////////////////////////////////////////
//
// Revision History
//
// Version
// 6.0 Initial version
// 7.0 Changed If statement to look for 'char(' and 'char'
//
//////////////////////////////////////////////////////////////////////////////
//
// Copyright © 1996-1997 Sybase, Inc. and its subsidiaries. All rights reserved.
// Any distribution of the PowerBuilder Foundation Classes (PFC)
// source code by other than Sybase, Inc. and its subsidiaries is prohibited.
//
//////////////////////////////////////////////////////////////////////////////
n_cst_columnattrib lnv_columnattrib
// check arguments and references
If Not IsValid(ilv_requestor) Then Return -1
If IsNull(ai_column) or (ai_column < 1) then Return -1
// do not sort if column header sorting is off
If Not of_IsColumnHeader() Then
Return 0
Else
// do not sort if this column is excluded from the sort
If of_IsExclude(ai_column) Then
Return 0
End If
If ai_column <> ii_CurrentSortCol Then
ie_CurrentSort = ascending!
ii_CurrentSortCol = ai_column
Else
If ie_CurrentSort = ascending! Then
ie_CurrentSort = descending!
Else
ie_CurrentSort = ascending!
End if
End if
// Default sort is alphanumeric
// Determine the datatype of the column and then call the appropriate Sort Mechanism
ilv_requestor.of_GetColumnInfo(ai_column, lnv_columnattrib)
If lower(left(lnv_columnattrib.is_ColType, 4)) = "char" then
// CHARACTER DATATYPE
ilv_requestor.Sort(ie_CurrentSort, ai_column)
ELSE
// ALL OTHER DATATYPES
ilv_requestor.Sort(UserDefinedSort!, ai_column)
End If
End If
return 1
end event