Xbasic

A5W_GRID Function

Syntax

A5W_GRID( Properties as P [, Show_Raw_Code as L ] )

Arguments

Properties

A pointer that controls the display properties of the resulting grid. See Components below

Show_Raw_Code

A logical flag that when set to true will display the Xbasic/HTML code used to generate the resulting web page. This option can be useful when learning to write Application Server pages and is usually used in the Interactive Window.

Description

Creates an HTML grid (browse) of records from a specific table.

Discussion

The A5W_GRID() function creates an HTML grid (browse) of records from a specific table. This function only works with the Application Server.

Deprecated. This function is deprecated as of V10. It will not be available in future versions. Populate the Properties dot variable before calling the function.

Components

  • .data.source

    Required. The name of the table to retrieve the data from.

  • .data.index

    Optional. Sets the primary index for the table.

  • .grid.border

    Optional. Default = 0. The size of the grid (HTML table) border.

  • .grid.cellspacing

    Optional. Default = 1. The amount of grid (HTML table) cell spacing.

  • .grid.cellpadding

    Optional. Default = 2. The amount of grid (HTML table) cell padding.

  • .grid.bgcolor

    Optional. Default = #F5F5F5. The background color to be used for the grid (HTML table).

  • .grid.header.font_face

    Optional. Default = Arial. The font face to be used for the column headings (field names).

  • .grid.header.font_size

    Optional. Default = 4. The font size to be used for the column headings (field names).

  • .grid.header.font_color

    Optional. Default = #0000FF. The font size to be used for the column headings (field names).

  • .grid.header.bgcolor

    Optional. Default = #D3DCE3. The row background color to be used for the column headings (field names).

  • .grid.data.max_rows

    Optional. Default = 10. The maximum number of rows (records) to be displayed.

  • .grid.data.font_face

    Optional. Default = Arial. The font face to be used for the data columns (fields).

  • .grid.data.font_size

    Optional. Default = 3. The font size to be used for the data columns (fields).

  • .grid.data.font_color

    Optional. Default = #000000. The font size to be used for the data columns (fields).

  • .grid.data.bgcolor

    Optional. Default = #DDDDDD. The row background color to be used for the data columns (fields).

  • .grid.data.alternate_rows

    Optional. Default = .F.. A logical flag to allow alternating rows of data to differ in their display. When false, all data rows are displayed the same. When true, rows of data alternate using the values above and below.

  • .grid.data.alt.font_face

    Optional. Default = Arial. The font face to be used for the even data columns (fields) when Properties.grid.data.alternate_rows is set to true.

  • .grid.data.alt.font_size

    Optional. Default = 3. The font size to be used for the even data columns (fields) when Properties.grid.data.alternate_rows is set to true.

  • .grid.data.alt.font_color

    Optional. Default = #000000. The font color to be used for the even data columns (fields) when Properties.grid.data.alternate_rows is set to true.

  • .grid.data.alt.bgcolor

    Optional. Default = #CCCCCC. The row background color to be used for the even data columns (fields) when Properties.grid.data.alternate_rows is set to true.

  • .column.1.data_expression

    Optional. If .column is omitted, all of the fields in the table are displayed. If any of .column is defined, .data_expression is required. The expression used to define the data in the first column. This can be as simple as a field name or more complex such as an expression. Currently limited to a field name only.

  • .column.1.column_label

    Optional. Default = data_expression. The column label to be displayed.

  • .column.1.drilldown

    Optional. Not Defined

  • .column.1.drilldown_event

    Optional. Not Defined

  • .column.1.hyperlink

    Optional. An expression to define the hyperlink for the data in this column.

Example

This code in an A5W page will create an HTML page with a grid showing all of the firstname, lastname, city, and company fields of the first 5 records in the Customer table.

p.data.source = "customer"
p.grid.data.max_rows = 5
p.data.column.1.data_expression = "Firstname"
p.data.column.2.data_expression = "Lastname"
p.data.column.3.data_expression = "City"
p.data.column.4.data_expression = "Company"

This code run in the Interactive Window will show the combination of Xbasic and HTML required to create the output of the A5W page in the previous example.

p.data.source = "customer"
p.grid.data.max_rows = 5
? a5w_grid(p, .t.)

Limitations

Web publishing applications only.

See Also