Provides several generic methods for Intrexx tables that can be used within both a view table and a free layout table.

Example

// Get table
var tableCtrl = ix.api.dom.getControl("<TABLE-GUID>");
// Get table rows
tableCtrl.getRows();
// Get table columns
tableCtrl.getCols();
// Reload table
tableCtrl.reload();

Hierarchy

  • ContainerTable
    • Table

Implements

  • Datarange

Methods

  • Returns a cell of the table for a specific table record. May be necessary to access elements within a table and within a data record. If you now have a control, you can use other methods on it, e.g. getValue, getRecord and others. See also Cell.

    Works only in a free layout table.

    Parameters

    • element: HTMLElement

    Returns null | Cell

    Example

    // Get table
    var tableCtrl = ix.api.dom.getControl("<TABLE-GUID>");
    // Get all columns
    var cols = tableCtrl.getCols();
    // Get cell value in first column and first row
    tableCtrl.getCell(cols[0].controls[0].getHtml());
    // Get cell value in third column and second row
    tableCtrl.getCell(cols[2].controls[1].getHtml());
  • Retrieves a column using its GUID. To determine the GUID of a column, you can use getCols.

    Free layout tables don't have real columns because they repeat a whole Intrexx page for each data record. Therefor they return Intrexx controls just like Text, Button, Image, Checkbox, Email and so on.

    Parameters

    • guid: string

      The unique identifier (GUID) of the column to be retrieved.

    Returns Column

    The column from the table that matches the column GUID.

    Example

    // Get table
    var tableCtrl = ix.api.dom.getControl("<TABLE-GUID>");
    // Get column
    var col = tableCtrl.getCol("<COLUMN-GUID>");
    console.log(col);
  • Retrieves all columns from the table.

    View tables columns are the Intrexx controls, e.g. a table with two columns first column shows a title with the Text control and the second is an image Button control.

    Month Action
    January Button
    February Button
    March Button

    Free layout tables don't have real columns because they repeat a whole Intrexx page for each data record. Therefor they return Intrexx controls just like Text, Button, Image, Checkbox, Email and so on for each data record.

    Important: In a free layout table the controls have dynamic unique IDs, so they will change with every page reload!

    Returns Column[]

    An array of table columns.

    Example

    // Get table
    var tableCtrl = ix.api.dom.getControl("<TABLE-GUID>");
    // Get columns
    var cols = tableCtrl.getCols();
    console.log(cols);
  • Returns the HTML of the control.

    Returns ContainerHtml

    Example

    // Get table
    var tableCtrl = ix.api.dom.getControl("<TABLE-GUID>");
    // Get html element
    var tableHtml = tableCtrl.getHtml();
    console.log(tableHtml);
  • Returns specific record for given record ID.

    Parameters

    • recId: string | HTMLElement

    Returns null | Row

    Example

    // Get table
    var tableCtrl = ix.api.dom.getControl("<TABLE-GUID>");
    // Get row
    var row = tableCtrl.getRow("<RECORD-ID>");
    console.log(row);
  • Returns a list with all records of the current table page.

    Parameters

    • content: string | HTMLElement = ...

    Returns Row[]

    Example

    // Get rows
    var tableCtrl = ix.api.dom.getControl("<TABLE-GUID>");
    // Iterate over each row to change their background color
    var rows = tableCtrl.getRows()
    rows.forEach((row) => row.getHtml()[0].style.backgroundColor = "blue");
  • Asynchronous reload of a table.

    Parameters

    Returns Promise<any>

    Example

    // Get table
    var tableCtrl = ix.api.dom.getControl("<TABLE-GUID>");
    // Reload table with settings
    tableCtrl.reload({
    bAsync: true,
    bAddHistory: true,
    bWaitAnimation: false,
    oRequestMap: {
    rq_company: 'INTREXX',
    rq_city: 'Freiburg'
    }
    });

    Example

    // Get table
    var tableCtrl = ix.api.dom.getControl("<TABLE-GUID>");
    // Reload table
    $.when(tableCtrl.reload())
    .then(function() {
    alert("done");
    })
    .fail(function() {
    alert("failed");
    });