class_="table"

Using <widget class_="table"> creates a fixed table ideal for displaying a relatively small dataset. The current maximum size for a table widget is 1000 rows and 500 columns. Any results from a 1010data query can be displayed in this table/grid element.

Syntax

<dynamic>
    <widget class_="table" label_="[RESULT_TABLE_NAME]">
        [1010data_QUERY]
    </widget>
</dynamic>

The [1010data_QUERY] may be specified between the opening and closing tags of the <widget>. The results of the query provide data for the <widget> to display.

Attributes

The attributes in this list are specific to widgets with class_="table".

label_
Accepts text that is used as a label for the widget.
labelpos_
Accepts a string that specifies the position of the label for the widget.

Valid values are:

  • left
  • right
  • top
  • bottom

The default is left.

labelwidth_
Accepts an integer that specifies the width of the label for the widget.

If the length of the string specified by the label_ attribute is greater than the value specified for labelwidth_, the text will wrap over multiple lines.

If the labelwidth_ attribute is not specified, the default width is the length of the string specified by the label_ attribute.

headers_
Specifies whether to display the column headings or column names at the top of the columns in the table widget.

Valid values are

labels
Display the column headings at the top of the columns in the table widget.
names
Display the column names at the top of the columns in the table widget.

The default is labels.

maxrows_
Accepts an integer value that specifies the maximum number of rows in which the query associated with the widget can result.

If the query associated with the widget results in a number of rows that exceeds the value specified to maxrows_, then the widget produces an error.

The default value is 1000.

maxcols_
Accepts an integer value that specifies the maximum number of columns that can be displayed by the widget.

If the query that populates the widget results in a number of columns that exceeds the value specified to maxcols_, then the widget produces an error.

The default is 500.

Example for class_="table"

This example creates a table widget that displays the results after selecting the rows where store=1 in the base table pub.demo.retail.item. The column names are displayed at the top of the columns, as specified by the headers_ attribute.

<dynamic>
  <widget class_="table" base_="pub.demo.retail.item" 
   label_="Sales Item Detail" labelpos_="top" 
   headers_="names">
    <sel value="store=1"/>
  </widget>
</dynamic>