Table Class

A Table control enables you to display entries in a table using rows and columns. As the Table class is a subclass of the Control class, it inherits all of the properties and methods defined in the Control and Window classes.

The table control also enables you to have many different sheets in the table, of which only one is visible at any time. The heading for each sheet is displayed in a selectable tab at the top of the control. When the user clicks on that tab, the corresponding sheet of the table is displayed (that is, both the click and the sheetChg events occur).

The number of rows and columns on a sheet is controlled by the rows and columns properties. Changing the value of the column or row property does not cause the table to be repainted. Table control subclasses do not reference mousePointer in a mouseDown event to determine if the mouse is in the resize position (that is, positioned over the dividing lines between fixed columns or rows).

Use the allowResize property to specify whether users can resize the rows and columns of a table. (The resizeColumn and resizeRow event methods are called when a resize operation has been performed using the mouse on a table column or row, respectively.)

The Table control class has the following behavior.

Table cells on a form defined as a Web page can contain pictures and labels only.

The table enables you to control the background color, text color, alignment, and picture displayed for each cell. Each cell can also be input-capable.

Although the table control can display a maximum of 63 sheets, the resulting size of the tabs prevents this limit being a reasonable option. Each sheet can have a maximum of 16,000 columns and 32,000 rows. These maximum limits cannot be achieved, however, as too much memory is required to be able to be run the application effectively.

The table can also be defined with fixed rows and columns. Fixed columns are usually the headings for each row and column. These rows and columns are always displayed, and do not scroll with the rest of the table.

Set the dropDown property to enable the table to fold up when focus is lost, showing only the current row.

Each sheet can be sorted by using the contents of one through six columns. Rows and columns on a sheet can be hidden.

By default, a table has one defined sheet. Use the sheets property to control the number of sheets in the table. The current sheet that is being accessed by logic is defined by the sheet property. The current sheet that is displayed is defined by the topSheet property.

The rows and columns properties control the number of rows and columns in each sheet. Rows can also be added to the table by using the addItem and addItemAt methods. If you add rows by using either of these methods, the text for each cell should be concatenated into one string, with the text of each cell separated by a tab character.

Use the text property to access the text for each cell. The current sheet, row, and column are then used to access the text in that cell. When setting the text property, the current cell in the current row is filled with the text that is passed. If the text contains tab characters, this character is assumed to be the end of the text for a cell, and the next cell is then filled with the remainder of the text, and so on. If all cells in the row are filled and there is more text, the remainder is ignored.

As table controls do not support a row height larger than the table, only the visible part of the row is displayed.

Move around the cells of a table by using the mouse, arrow keys, or Home, End, Page Up, or Page Down keys. Tables are scrolled by rows, not by pixels. When an input-capable cell has the focus, it may be necessary to also press the Alt key, as navigation keys may also have meaning to the text or combo boxes in these cells.

Press Ctrl+Home to move a table with an associated collection to the first entry in the collection. Conversely, press Ctrl+End to move the display to the last entry in the collection.

Pressing the Home key on a table moves the display to the first entry that has been loaded in the control. Pressing the End key moves the display to the last entry currently loaded in the control. Using the Ctrl key for a list box that does not have a collection attached has the same result as pressing the Home or End key without the Ctrl key.

You can set the width of a column to a percentage of the client width of a table. For details, see the widthPercent property of the JadeTableColumn class. To control how any columns percentages set on the table sheet using the widthPercent property are interpreted, use the widthPercentStyle property of the JadeTableSheet class.

When writing your logic to handle Table controls, you can:

The effect of logic changing a font property for a sheet, row, column, or cell that has no font settings of its own is that all the other font properties are also set from the default font that applies.

The accessMode property provides multiple meanings for the alignment, backColor, comboIndex, foreColor, fontName, fontSize, fontBold, fontItalic, fontUnderline, fontStrikethru, inputType, maxLength, partialTextIndication, and wordWrap properties of Table controls.

When the text of a sorted column changes, the automatic sorting of rows occurs only when the Table class addItem method adds a new row or the Table class resort method is used.

When a collection is attached to a table and the current row is scrolled so that it will be discarded (outside of the displayed virtual window over the collection), the queryRowColChg and rowColumnChg event methods are called. If the queryRowColChg event is rejected, the scroll action is discarded. (Note that the queryRowColChg event passes the current row and column values as parameters, because the actual current row number remains unchanged after scrolling.)

For an example and details about merging cells in a table, see the JadeTableCell class mergeCells property and getCellWidth method. For details about the support of mouse wheel requests to scroll up, down, or across a table control, see "Window Class", earlier in this document.

For the arrays associated with tables (for example, Table.columnVisible), the only methods that are implemented are at, atPut (which enables you to use the square brackets notation to access the elements), createIterator (which allows logic to do a foreach over the array), size, and size64.

For an overview of directly accessing properties and methods in a table element (for example, a cell or a row) without using the accessMode property, see "Directly Accessing Table Elements". For a summary of the constants, properties, methods, and events defined in the Table class, see "Table Class Constants", "Table Properties", "Table Methods", and "Table Events", in the following subsections.