J6/Grid/Class

From J Wiki
Jump to navigation Jump to search
J6/Grid | Data Options Types | Actions Events Methods | Class DerivedClass | Hierarchical MultiDimensional MultiLine Virtual | Examples

The code that paints the grid is in an object derived from one or more grid classes. The main grid class is jzgrid, and other grid classes such as jsgrid extend this class, see Derived Class. The jzgrid class is fairly complete and can be used by itself.

Load the grid by loading the class, for example:

load 'jzgrid'

A grid is drawn in an isigraph control on a J form. The verb that creates the form should also create an instance of the grid class, and set values in the instance to define the grid. The noun CELLDATA is the data for the grid, and is always required. Other values are set to defaults if not given.

Most events for the isigraph control should be passed to the grid instance for execution, see Events.

The verb show shows the grid, or refreshes the grid if it is already displayed. The argument specifies grid options, either as:

  • a character string of names that can be read from the form locale.
  • a 2 column boxed matrix of names and corresponding values.

Options are listed in Options. Option names are always uppercase in grid, and are converted if necessary.

See Examples.