Request_Search - cCJGrid
Invokes a popup dialog that allows you to type in a search value for the sort column
Type: Procedure
Parameters
| Parameter | Type | Description |
|---|---|---|
| iKeyCode | Integer | Virtual key code (Please see the "Codejock Xtreme Report Control" documentation for more information.) |
| iKeyShift | Integer | Virtual Shift key code (Please see the "Codejock Xtreme Report Control" documentation for more information.) |
Syntax
Procedure Request_Search Integer iKeyCode Integer iKeyShift
Call Example
Send Request_Search iKeyCode iKeyShift
Description
This invokes a small popup dialog that allows you to type in a search value for the sort column, which is identified by piSortColumn. This is used automatically by prompt lists (cCJGridPromptList and cDbCJGridPromptList) and can be used in customized cCJGrid and cDbCJGrid classes and objects. The key-codes passed, iKeyCode and iKeyShift, are the virtual keys provided by the grid's OnComKeyDown message and are used by prompt lists to pass the key value that invokes the list. If you pass zero for these values, no seeding occurs. If you use this on a custom basis, you will probably pass zero.
The following creates a read-only grid class that supports popping up a search dialog when Ctrl+S is pressed.
Class cCJGridRO is a cCJGrid
Procedure Construct_Object
Forward Send Construct_Object
Set pbEditOnKeyNavigation to False
Set pbEditOnClick to False
Set pbReadOnly to True
Set pbFocusSubItems to True
Set pbShadeSortColumn to True
Set pbHeaderReorders to True
Set pbHeaderTogglesDirection to True
Set pbHeaderSelectsColumn to True
Set peHorizontalGridStyle to xtpGridNoLines
Set pbUseFocusCellRectangle to False
Set pbSelectionEnable to True
On_Key Key_Ctrl+Key_S Send DoSearch
End_Procedure
Procedure DoSearch
Send Request_Search 0 0
End_Procedure
End_Class
This method calls the RequestColumnSearch method. When this method is used with a static grid (cCJGrid or cDbCJGrid with pbStaticData set True), this will perform the search by calling RequestFindColumnValue. When used with a dynamic cDbCJGrid, it performs a database search by calling RequestColumnLookup.