Data grid

A data grid is a scrollable table where data is displayed. Any results from a 1010data query can be displayed in this table/grid element.

Type
Determines the type of data grid.

Valid options are:

Native grid
Display a traditional 1010data grid.

ScrollGrid
Display a smooth-scrolling grid.

Label
The title of the data grid that displays the results of your query.

Show rows/cols?
When selected, display information directly beneath the table title regarding the number of rows and columns in the table.

Column headers
The column heading, name, or a combination of both can be displayed at the top of each column in a data grid.

Valid options are:

Label
The column heading will be displayed at the top of each column (e.g., Transaction ID).

Name
The column name will be displayed at the top of each column (e.g., transid).

Both
Both the column heading and the column name will be displayed at the top of each column.

Region format
Determines what format the data grid uses for dates and numbers.

Valid options are:

  Date Date+Time Integer Decimal
USA MM/DD/YY MM/DD/YY_HH:MM:SS 10,000 0.001
Europe DD.MM.YY DD.MM.YY_HH:MM:SS 10.000 0,001
United Kingdom DD/MM/YY DD/MM/YY_HH:MM:SS 10,000 0.001
Show repeated rows as
This determines how repeated values will be displayed within a particular column in a data grid.

Valid options are:

Actual value
If a particular cell has the same value as the cell in the row above it, the same value will be displayed in that cell. This is the default setting.

Ditto mark
If a particular cell has the same value as the cell in the row above it, a ditto mark (") will be displayed in that cell.

Ditto (fixed columns only)
Within a fixed column, if a particular cell has the same value as the cell in the row above it, a ditto mark (") will be displayed in that cell. Otherwise, if it is not a fixed column, the same value will be displayed.
Note: In this example the State column is fixed, but Unemployment Rate is not.
Blank
If a particular cell has the same value as the cell in the row above it, the cell will appear blank.

Blank (fixed columns only)
Within a fixed column, if a particular cell has the same value as the cell in the row above it, the cell will appear blank. Otherwise, if it is not a fixed column, the same value will be displayed.
Note: In this example the State column is fixed, but Unemployment Rate is not.
Show totals?
Specifies whether to show totals when the query results displayed in the grid are from a tabulation.

Clickable column(s)
A comma-separated list of column names whose cells will be clickable.

When a cell is clicked, several interactions can take place, depending on other options that have been set.

See Variable for click value and Variable for click selector below for additional information.

Sortable column(s)
A comma-separated list of column names whose contents may be sorted in ascending or descending order.

See Variable for sorted columns and Variable for sorted directions below for additional information.

Variable for click value
When a cell in a clickable column is clicked, its value is stored in this variable.

You may select a variable from the dropdown, or you can create a new variable by clicking New... and entering the name in the field following the @ symbol.

Variable for click selector
When a cell in a clickable column is clicked, the name of that column is stored in this variable.

You may select a variable from the dropdown, or you can create a new variable by clicking New... and entering the name in the field following the @ symbol.

Variable for click row package value
When a cell in a clickable column is clicked, the entire row of data is stored in this variable as a package.

You may select a variable from the dropdown, or you can create a new variable by clicking New... and entering the name in the field following the @ symbol.

Variable for click row index value
When a cell in a clickable column is clicked, the index of the row of data is stored in this variable.
Note: The first row in the data grid has an index of 0.

You may select a variable from the dropdown, or you can create a new variable by clicking New... and entering the name in the field following the @ symbol.

Variable for sorted columns
When a sortable column is sorted in ascending or descending order, the column name is added to the comma-separated list stored in this variable.

You may select a variable from the dropdown, or you can create a new variable by clicking New... and entering the name in the field following the @ symbol.

Variable for sorted directions
When a sortable column is sorted in ascending or descending order, the sort direction (up or down) is added to the comma-separated list stored in this variable.

You may select a variable from the dropdown, or you can create a new variable by clicking New... and entering the name in the field following the @ symbol.

Drillable column(s)
A comma-separated list of column names whose cells will be drillable.

When a cell is clicked, several interactions can take place, depending on other options that have been set.

See Variable for drill values and Variable for drill selectors below for additional information.

Variable for drill values
When a cell in one of the drillable columns is clicked, the value will be appended to a comma-separated list of values contained in this variable.

You may select a variable from the dropdown, or you can create a new variable by clicking New... and entering the name in the field following the @ symbol.

Variable for drill selectors
When a cell in one of the drillable columns is clicked, the column name will be appended to a comma-separated list of column names contained in this variable.

You may select a variable from the dropdown, or you can create a new variable by clicking New... and entering the name in the field following the @ symbol.

Package Variable for drill
When a cell in one of the drillable columns is clicked, the column name and cell value are added to the lists (sel and val, respectively) stored in this package variable.

You may select a variable from the dropdown, or you can create a new variable by clicking New... and entering the name in the field following the @ symbol.

Using a package variable is helpful in cases where cell values in the drillable columns contain commas, since storing such values in Variable for drill values would cause an error.

Example

<note type="base">Applied to table: pub.demo.retail.item</note>
<dynamic selected_val="1" selected_col="store" selected_row_val="" 
selected_row_index_val="1" selected_value="">
  <widget base_="pub.demo.retail.item" class_="grid" clickable_="store,transid" 
indexvalue_="@selected_row_index_val" label_="Sales Item Detail" width_="800" 
name="hmadded__1" rowvalue_="@selected_row_val" selector_="@selected_col" 
value_="@selected_val">
    <willbe name="selected_value" value="{@selected_val}"/>
    <willbe name="selected_column" value="'{@selected_col}'"/>
    <willbe name="selected_index" value="{@selected_row_index_val}"/>
  </widget>
  <layout>
    <foreach item="selected_val,selected_col,selected_row_index_val" 
title="Value,Column,Row Index" tally_="@i">
      <layout>
        <widget class_="text" text_="{@title}" 
style_="font-weight:bold;letter-spacing:0;"/>
        <widget class_="text" text_="{@{@item}}"/>
      </layout>
    </foreach>
    <foreach col_name="date,transid,account,store" 
col_label="Date,Transaction ID,Account,Store" tally_="@i">
      <layout>
        <widget class_="text" text_="{@col_label}" 
style_="font-weight:bold;letter-spacing:0;"/>
        <widget class_="text" text_="{@selected_row_val.{@col_name}}"/>
      </layout>
    </foreach>
  </layout>
</dynamic>

Example

<note type="base">Applied to table: pub.demo.retail.prod</note>
<base table="pub.demo.retail.prod"/>
<defblock name="drill" hier="" cols="" vals="">
  <foreach col="{@cols}" val="{@vals}">
    <sel value="{@col}='{@val}'"/>
  </foreach>
  <tabu breaks="{csl_pick(csl_take(@hier;1+csl_len(@cols));-1)}" 
label="Tabulation">
    <tcol source="sku" fun="cnt"/>
  </tabu>
</defblock>
<dynamic hier="divdesc,deptdesc,classdesc,itemdesc" cols="" vals="">
  <widget class_="button" name="hmnonce__1" newvalue_1_="{csl_drop(@cols;-1)}" 
newvalue_2_="{csl_drop(@vals;-1)}" rotxlabels_="-65" text_="Roll back up" 
type_="set" value_1_="@cols" value_2_="@vals"/>
  <widget base_="pub.demo.retail.prod" class_="grid" cols="{@cols}" 
drillable_="{csl_pick(@hier;1+csl_len(@cols))}" drillselector_="@cols" 
drillvalue_="@vals" hier="{@hier}" insert_="drill" name="hmnonce__2" 
vals="{@vals}" width_="1000">
    <willbe name="test_cols" value="'{@cols}'"/>
    <willbe name="test_vals" value="'{@vals}'"/>
    <willbe name="test_hier" value="'{@hier}'" format="width:40"/>
  </widget>
</dynamic>

Example

<note type="base">Applied to table: pub.demo.retail.prod</note>
<dynamic hier="divdesc,deptdesc,classdesc,itemdesc" 
drillpkg="{pkg('sel' 'val';lst() lst())}">
  <widget class_="button" name="hmnonce__1" newvalue_="{lst_drop(@drillpkg.sel;-1)}" 
newvalue_2_="{lst_drop(@drillpkg.val;-1)}" text_="Roll back up" type_="set" 
value_="@drillpkg.sel" value_2_="@drillpkg.val"/>
  <widget base_="pub.demo.retail.prod" class_="grid" pkgdrillvalue_="@drillpkg" 
drillable_="{csl_pick(@hier;lst_len(@drillpkg.sel)+1)}" hier="{@hier}" 
name="hmnonce__2" width_="1000">
    <let level="{lst_len(@drillpkg.sel)}">
      <for i="1" to="{@level}">
        <sel value="{@drillpkg.sel[@i]}='{@drillpkg.val[@i]}'"/>
      </for>
      <tabu breaks="{csl_take(@hier;@level+1)}">
        <tcol source="sku" fun="cnt"/>
      </tabu>
    </let>
    <willbe name="test_cols" value="'{@drillpkg.sel}'"/>
    <willbe name="test_vals" value="'{@drillpkg.val}'"/>
    <willbe name="test_hier" value="'{@hier}'" format="width:40"/>
  </widget>
</dynamic>

Example

<note type="base">Applied to table: pub.demo.retail.item</note>
<dynamic sorted_columns="" sorted_direction="">
  <widget base_="pub.demo.retail.item" class_="grid" name="hmadded__1" 
sortable_="date,store,account" sortcols_="@sorted_columns" 
sortdirs_="@sorted_direction"/>
  <layout name="hmnonce_1">
    <widget class_="text" name="hmadded__2" 
text_="Sorted columns: {@sorted_columns}"/>
    <widget class_="text" name="hmadded__3" 
text_="Sort direction: {@sorted_direction}"/>
  </layout>
</dynamic>