Grid Modes API
pbDataAware
- If
False, data is loaded usingOnManualLoadData. This is triggered by sendingGridRefresh. - If
True,peDbGridTypedetermines how data is loaded.
peDbGridType
gtAutomatic: A normal data-aware grid. Grid data is loaded as needed. Column sorting, if allowed, is done on the server.gtAllData: Data is auto-loaded but this only occurs once, and all data is loaded. Column sorting, if allowed, is done on the client.gtManual: Data is manually loaded by usingOnManualLoadData. You must callGridRefreshto do this. Column sorting, if allowed, is done on the client.
Note: If
pbDataAwareisFalse, this property is not used.
pbColumnSortable
This enables column sorting when changing columns for all columns.
- When
True, grid columns are sorted when thecWebColumnpbSortableproperty isTrue. - When
False, column sorting is disabled.
This property is set to True for cWebLists and False for cWebGrids. The assumption here is that when doing data entry, you probably want to disable column sorting. It also requires the fewest changes in our samples.
The cWebColumn pbSortable default mechanism has changed. If the initial value is C_WebDefault, it will set the value to True if:
1. This is a data-aware, automatic grid and there is a sort field (this is how it always worked).
2. This is a static grid (either non-data aware or the peDbGridType is gtAllData or gtManual).
Changes in cWebPromptList
This now supports non-data aware prompt lists and all the other peDbGridType variations.
Example: A Static Data Aware Prompt List
Object oPromptList is a cWebPromptList
Set peDbGridType to gtAllData
This will load all data when the popup list is invoked. It will support sorting on all columns. Other than that, it's a normal prompt list.
Example: A Manually Loaded Data Aware Prompt List
Object oPromptList is a cWebPromptList
Set peDbGridType to gtManual
This will require that you add your load code in OnManualLoadData. It supports sorting on all columns.
Example Load Code
This would only load even-numbered customers.
Procedure OnManualLoadData tWebRow[] ByRef aTheRows String ByRef sCurrentRowID
Integer i
tWebRow TheRow
Boolean bOk
Clear Customer
Repeat
Find GT Customer by 1
Move (Found) to bOk
If (bOk) Begin
If ((Customer.Customer_Number/2.0) = Integer(Customer.Customer_Number/2)) Begin
Move (SerializeRowID(GetRowID(Customer.File_Number))) to TheRow.aValues[0]
Move Customer.Customer_Number to TheRow.aValues[1]
Move Customer.Name to TheRow.aValues[2]
Move Customer.Balance to TheRow.aValues[3]
Move TheRow to aTheRows[i]
Increment i
End
End
Until (not(bOk))
End_Procedure
If the sCurrentRowId byref parameter is not changed (i.e., it is blank), the list will use its normal seeding logic and attempt to find the value that was seeded by the invoking DEO. If a sCurrentRowId value is defined here, that becomes the current row. As with the Windows prompt lists, this provides a way to easily fill data using SQL. Note that there is no need to send RefreshGrid as the prompt list does this for you.
Example: A Non-Data Aware Prompt List
Object oPromptList is a cWebPromptList
Set pbDataAware to False
Procedure OnManualLoadData tWebRow[] ByRef aTheRows String ByRef sCurrentRowID
Integer i
tWebRow TheRow
String sSeed
WebGet psSeedValue to sSeed
For i from 1 to 100
Move i to TheRow.aValues[0]
Move i to TheRow.aValues[1]
Move ("Name_" + String(i)) to TheRow.aValues[2]
Move (100 + i) to TheRow.aValues[3]
Move TheRow to aTheRows[i-1]
If (String(i) = sSeed) Begin
Move sSeed to sCurrentRowID
End
Loop
End_Procedure
This is a non-data aware list. It will require that you add your load code in OnManualLoadData. It supports sorting on all columns.
Note: The allowed values for
peUpdateModefor a non-data aware prompt list areumPromptValue,umPromptCustom, andumPromptNonInvoking, but notumPromptRelational. In other words, a non-data aware prompt list cannot be relational. However,umPromptRelationalis the default for this class. Everyone will forget to change this. So if the list is non-data-aware and the mode isumPromptRelational, the object will change it toumPromptValue.
The seeding of a non-data aware list must be done inside of OnManualLoadData. This example shows how you could do this seeding by using the psSeedValue web property. Note that there is no need to send RefreshGrid as the prompt list does this for you.