{ WebProperty=Client } Property Integer piSortColumn
Web Property Read Access: | WebGet piSortColumn to IntegerVariable |
Web Property Write Access: | WebSet piSortColumn to IntegerVariable/Value |
Read Access: | Get piSortColumn to IntegerVariable |
Write Access: | Set piSortColumn to IntegerVariable/Value |
Determines which list column the list is currently sorted by. The first column is 0.
It is recommended that you always Set an initial piSortColumn in your code. Use a Set command for this.
Object oList is a cWebList : Set piSortColumn to 1
This is a web property and its value can be changed dynamically either on the client by client by clicking on a column header or via code using WebGet/WebSet.
Object oSearchOrderSalesP_ID is a cWebMenuItem Set psCaption to "List by Sales Person Id" Set peActionDisplay to adMenu Set pbBeginGroup to True Procedure OnClick WebSet piSortColumn of oList to 3 Send GridRefresh of oList End_Procedure End_Object
If this property is not set, it's value will be -1, meaning that it does not control the sort order.
When working with data-aware lists, follow these guidelines for controlling index order:
1. Use piSortColumn to control index order
2. Always set an initial piSortColumn value
3. If you need to further control index order, augment the IndexOrder function
4. Do not set these properties:
If you set peDbGridType to gtAllData, it will load all data to the client and will allow sorting on all columns (which is then done on the client).
See Indexes and Ordering with Data Aware cWebLists for a more complete description of this process.
Each web property maintains two values: The regular property value is set during object creation and should not be changed during the lifetime of that object. To access that value, use the standard property Get and Set syntax.
The web property value is the local value stored at each client. This is synchronized to the client's local value whenever a server call is being processed. To access the web property value, use the WebGet and WebSet syntax above instead of the standard Get and Set syntax.