Difference between revisions of "Grid"
From Lianjapedia
Yvonne.milne (Talk | contribs) |
Yvonne.milne (Talk | contribs) |
||
Line 45: | Line 45: | ||
|Numeric | |Numeric | ||
|Number of columns | |Number of columns | ||
+ | |- | ||
+ | |Filter | ||
+ | |RW | ||
+ | |Character | ||
+ | |Filter expression to restrict data included in the grid | ||
|- | |- | ||
|GridLineColor | |GridLineColor | ||
Line 170: | Line 175: | ||
|valign="top"|row as Numeric, column as Numeric | |valign="top"|row as Numeric, column as Numeric | ||
|valign="top"|Select the cell at the specified row and column position | |valign="top"|Select the cell at the specified row and column position | ||
+ | |- | ||
+ | |valign="top"|Add | ||
+ | |valign="top"|None | ||
+ | |valign="top"|Add a new record | ||
|- | |- | ||
|valign="top"|AddColumn | |valign="top"|AddColumn | ||
Line 190: | Line 199: | ||
|valign="top"|None | |valign="top"|None | ||
|valign="top"|Resize the columns to fit the grid | |valign="top"|Resize the columns to fit the grid | ||
+ | |- | ||
+ | |valign="top"|Cancel | ||
+ | |valign="top"|None | ||
+ | |valign="top"|Cancel data changes | ||
|- | |- | ||
|valign="top"|Clear | |valign="top"|Clear | ||
Line 198: | Line 211: | ||
|valign="top"|column as Numeric | |valign="top"|column as Numeric | ||
|valign="top"|Return an object reference to the specified [[Column]] | |valign="top"|Return an object reference to the specified [[Column]] | ||
+ | |- | ||
+ | |valign="top"|Delete | ||
+ | |valign="top"|None | ||
+ | |valign="top"|Delete the current record | ||
|- | |- | ||
|valign="top"|DoScroll | |valign="top"|DoScroll | ||
|valign="top"|scroll as Numeric | |valign="top"|scroll as Numeric | ||
|valign="top"|Scroll: 0 = up, 1 = down, 2 = page up, 3 = page down, 4 = left, 5 = right, 6 = page left, 7 = page right, 8 = top, 9 = bottom | |valign="top"|Scroll: 0 = up, 1 = down, 2 = page up, 3 = page down, 4 = left, 5 = right, 6 = page left, 7 = page right, 8 = top, 9 = bottom | ||
+ | |- | ||
+ | |valign="top"|First | ||
+ | |valign="top"|None | ||
+ | |valign="top"|Move to the first data record | ||
|- | |- | ||
|valign="top"|Goto | |valign="top"|Goto | ||
Line 210: | Line 231: | ||
|valign="top"|row as Numeric, column as Numeric | |valign="top"|row as Numeric, column as Numeric | ||
|valign="top"|Return the item text from the specified cell | |valign="top"|Return the item text from the specified cell | ||
+ | |- | ||
+ | |valign="top"|Last | ||
+ | |valign="top"|None | ||
+ | |valign="top"|Move to the last data record. For paginated grids, move to the first record on the last page. | ||
+ | |- | ||
+ | |valign="top"|MoveNext | ||
+ | |valign="top"|None | ||
+ | |valign="top"|Move to the next page | ||
+ | |- | ||
+ | |valign="top"|Previous | ||
+ | |valign="top"|None | ||
+ | |valign="top"|Move to the previous page | ||
|- | |- | ||
|valign="top"|RemoveColumn | |valign="top"|RemoveColumn | ||
Line 218: | Line 251: | ||
|valign="top"|existing as Object | |valign="top"|existing as Object | ||
|valign="top"|Remove the specified object | |valign="top"|Remove the specified object | ||
+ | |- | ||
+ | |valign="top"|Save | ||
+ | |valign="top"|None | ||
+ | |valign="top"|Save data changes | ||
|- | |- | ||
|valign="top"|Search | |valign="top"|Search |
Revision as of 10:37, 10 July 2014
Note: property, method and event names should be referred to in lowercase in case-sensitive scripting languages.
Properties
This class supports the Common Properties plus the following:
Property | Access (R/RW) | Value | Description |
---|---|---|---|
ActiveColumn | RW | Numeric | Currently selected column |
ActiveRow | RW | Numeric | Currently selected row |
AlternatingRowColors | RW | Boolean | Whether rows have alternating background colors |
AutoPagination | RW | Boolean | Whether grids are paginated over the table size specified in AutoPaginationSize, default is True |
AutoPaginationSize | RW | Numeric | Table size (number of records) over which AutoPagination applies, default is 1000 |
AutoResizeColumns | RW | Boolean | Whether grid auto resizes to the maximum width when data is loaded |
ColumnCount | RW | Numeric | Number of columns |
Filter | RW | Character | Filter expression to restrict data included in the grid |
GridLineColor | RW | Numeric | Color of grid lines |
GridLines | RW | Boolean | Whether grid lines are displayed |
HeaderHeight | RW | Numeric | Column header height in pixels |
Pagination | RW | Boolean | Whether grids are paginated regardless of table size, default is False |
Picture | RW | Character | Filename of background image |
Readonly | RW | Boolean | Whether grid is readonly |
Recno | R | Numeric | Current record number |
RecordMark | RW | Numeric | Whether record number column is displayed: 0 (False), 1 (True) |
RecordSource | RW | Character | Source of data to which the grid is bound |
RecordSourceType | RW | Numeric | Data source type: 0 = table, 1 = alias, 4 = SQL statement |
RelativeColumn | R | Numeric | Currently selected column relative to the grid display |
RelativeRow | R | Numeric | Currently selected row relative to the grid display |
RowColChange | RW | Numeric | Type of cell movement made: 0 = no change, 1 = row change, 2 = column change, 3 = row and column change |
RowCount | RW | Numeric | Number of rows |
RowHeight | RW | Numeric | Row height in pixels |
Rowid | R | Numeric | Current record number |
RowSource | RW | Character | Source of data to which the grid is bound |
RowSourceType | RW | Numeric | Data source type: 1 = table, 2 = alias, 3 = SQL statement |
Scrollbars | RW | Numeric | Scrollbars displayed: 0 = none, 1 = horizontal, 2 = vertical |
StretchLastColumn | RW | Boolean | Whether the last grid column is stretched to fill the available space |
ViewMode | RW | Boolean | View mode for split grids: 0 = grid view, 1 = form view, 2 = split view |
WordWrap | RW | Boolean | Whether text is word-wrapped |
Methods
This class supports the Common Methods plus the following:
Method | Args | Description |
---|---|---|
ActivateCell | row as Numeric, column as Numeric | Select the cell at the specified row and column position |
Add | None | Add a new record |
AddColumn | column as Numeric | Add a column at the specified column position |
AddItem | data as Character | Add an item |
AddItems | selectstatement as Character | commalist as Character | pipelist as Character | items as Array [,headers as Array[, headerwidths as Array]] | Add items based on an SQL SELECT query, a comma-separated list, a pipe-separated list or an array, optionally specifying a second array with column header text and a third with column header widths |
AddObject | existing as Object | newobject as Character, class as Character | Add an existing object or a new object, in which case the object's class must also be specified and optionally its caption |
Autofit | None | Resize the columns to fit the grid |
Cancel | None | Cancel data changes |
Clear | None | Clear the grid |
Columns | column as Numeric | Return an object reference to the specified Column |
Delete | None | Delete the current record |
DoScroll | scroll as Numeric | Scroll: 0 = up, 1 = down, 2 = page up, 3 = page down, 4 = left, 5 = right, 6 = page left, 7 = page right, 8 = top, 9 = bottom |
First | None | Move to the first data record |
Goto | recordnumber as Numeric | Go to the specified record number |
Item | row as Numeric, column as Numeric | Return the item text from the specified cell |
Last | None | Move to the last data record. For paginated grids, move to the first record on the last page. |
MoveNext | None | Move to the next page |
Previous | None | Move to the previous page |
RemoveColumn | column as Numeric | Remove a column at the specified column position |
RemoveObject | existing as Object | Remove the specified object |
Save | None | Save data changes |
Search | searchstring as Character | Search for searchstring in the currently selected column |
Sort | column as Numeric, direction as Numeric | Sort data on the specified column. Data is sorted in descending order if direction < 0. Note: Sort uses the index tag fieldname_lower where fieldname is the name of the field in the specified column. If the index tag does not already exist, it creates one in string order based on lower(etos(fieldname)). For alternative orders, the index tag should be created in advance, e.g. to sort on southwind!products.supplierid in numeric order: index on supplierid tag supplierid_lower or index on strzero(supplierid) tag supplierid_lower. Note: Column numbers start from 0. |
Events
This class supports the Common Events plus the following:
Event | Args | Description |
---|---|---|
afterRowColChange | row as Numeric | Occurs after moving column in the same row. Row numbers start from 0. |
beforeRowColChange | column as Numeric | Occurs after data has changed and before the valid event. Column numbers start from 0. |
dragDrop | source as Object, x as Numeric, y as Numeric, state as Numeric | Occurs when an object is dropped into the grid |
dragOver | source as Object, x as Numeric, y as Numeric, state as Numeric | Occurs when an object is dragged over the grid |
interactiveChange | None | Occurs after data has been changed interactively and after the valid event |