CreateRow

Creates a row in an ItemTable control.

Syntax

function CreateRow(sDisplayText, sData, oRowValues, fDblClickEvent, bSelectable)

Parameters

sDisplayText
Type: String

The display text for the row.

sData
Type: String

The identifier for the row.

oRowValues
Type: Array

An array of column values for the row.

fDblClickEvent
Type: Function

The function invoked when the row is double-clicked by the user.

bSelectable
Type: String

Infrastructure. Nintex internal use only.

Remarks

This function adds a row to the table body of the table for an ItemTable control.

Invoking this function performs the following actions:

  1. The function ensures that a <tbody> element exists for the control, and then appends a <tr> element for the table row to the <tbody> element, as a child.

  2. The identifier for the table row is set to the following value, where <sDataTrim> is the value specified in sData, with all space characters removed:

    tr<sDataTrim>
  3. If the RowsSelectable property of the control is set to true, the ms-itmhover style is used for the table row and the onclick event is set to use the SelectRow function for the control.

  4. The data attribute of the table row is set to the value specified in sData.

  5. The function creates two cells in the table row, which both use the ms-vb2 style.

    The first table cell is empty, for spacing purposes. The second table cell contains a link to an empty bookmark, in which the text is set to the value specified in sDisplayText and the identifier is set to the following value, where <sDisplayText> is the value specified in sDisplayText:

    wfVarName<sDisplayText>

    These two cells typically display workflow variables, similar to the display in the Workflow Variables dialog from the Workflow designer. The link in the second table cell is also referred to as the content link for that table row.

  6. If an array was specified in oRowValues, the function performs the following actions:

    1. Appends a table cell, which uses the ms-vb2 style, to the table row for each value in the array, and then sets the value of the cell to the value in the array.

      If a CellImageLink object is included in the array, the table cell for that object is defined by the BuildHtmlElement function of the CellImageLink object, and the width of the table cell is determined by the value of the ColWidth property of the CellImageLink object.

    2. Appends an empty cell to the table row, for spacing purposes.

  7. If an array was not specified in oRowValues, the function appends two empty cells to the table row, for spacing purposes.

  8. The function refreshes the table, sorting the table rows as necessary.

Example

The following example demonstrates how to use this function in the TPARetrieveConfig function of a custom workflow action to create a row with three visible columns, in which the first visible column is displayed as a link. The function specifies that a function named DoubleClickRow should be invoked when the row is double-clicked.

var displayName = 'Column 2';
CreateRow(displayName, 
    displayName.toLowerCase(), 
    new Array('Column 3', 'Column 4'), 
    DoubleClickRow);

See Also

Concepts

Configuration pages

Operations

Interacting with user inputs

Reference

JavaScript Reference