Class: TableConfiguration

$k. TableConfiguration

new $k.TableConfiguration()

Configuration of a table

Extends

Methods

static$k.TableConfiguration.forDomain(domain, context) : $k.TableConfiguration

Returns the table confguration for the domain and the optional context)

Name Type Description
domain $k.Domain

Domain or internal name of a type of the table

context $k.SemanticElement optional

Context of the configuration

Since:
  • 4.1.0
Returns:
Type Description
$k.TableConfiguration

static$k.TableConfiguration.from(configurationElement) : $k.TableConfiguration

Returns the confguration defined by the element

Name Type Description
configurationElement $k.SemanticElement

The configuration element

Since:
  • 4.1.0
Returns:
Type Description
$k.TableConfiguration

columns(domain, contextObject) : object

Returns the columns of the table

Name Type Description
domain $k.Domain

Domain or internal name of a type of the table

contextObject object optional

JSON render context object

Since:
  • 4.1.0
Returns:
Type Description
object

configElement() : $k.SemanticElement

Since:
  • 4.1.0
Returns:
Type Description
$k.SemanticElement

context(contextObject) : $k.TableConfiguration

Set context object

Name Type Description
contextObject object

Context object

Deprecated
  • Use setContext()
    Returns:
    Type Description
    $k.TableConfiguration

    createFilterProperties(element)

    Create properties for each column with a filter value to the element

    Name Type Description
    element $k.SemanticElement
    Version:
    • Experimental feature, might be removed at any time
    Since:
    • 4.1.0

    elements(elementsOrQuery, keyFilter, detailFilter) : Array.<$k.SemanticElement>

    Returns the filtered, sorted and paged elements of this table

    Name Type Description
    elementsOrQuery optional

    Filter, sort and page elements. Input value ​​can be: elements (no search, only filter, sort and page), a search (search the elements to used) or undefined (Internally, a search with the context object built)

    keyFilter object optional

    Alternative 1: An array of strings defining a filter which property names to include.

    Alternative 2: An object with "include" and/or "exclude" keys

    {"exclude": ["key1", ...]}
    includes all but the listed properties, while
    {"include": ["key1", ...]}
    or
    ["key1", ...]
    includes only the listed properties.

    Non-optional properties are always included

    detailFilter object optional

    A filter to define the granularity of the JSON structure

    [ "schema" ]
    includes json with schema information

    Since:
    • 4.2.0
    Returns:
    Type Description
    Array.<$k.SemanticElement> The filtered, sorted and paged elements

    filter(elements, filterDescriptions, disableInheritance) : Array.<$k.SemanticElement>

    Filters the elements by the given column values

    Name Type Description
    elements Array.<$k.SemanticElement>
    filterDescriptions Array.<object>

    Column index/name and value

    disableInheritance boolean optional

    True if the query should only match direct instances/subtypes

    Since:
    • 4.1.0
    Throws:
    Type Description
    $k.exception.InvalidValue

    If the filter values are invalid

    $k.exception.MissingParameter

    If the filter value for a column is missing

    $k.exception.QueryError

    If filtering was not possible

    Returns:
    Type Description
    Array.<$k.SemanticElement> The filtered elements
    Example

    configuration.filter(elements, [ {column: "familyName", value: "Doe" }])

    render(elements, keyFilter, detailFilter) : Array.<object>

    Renders the elements as literal objects

    Name Type Description
    elements optional

    Elements, query or undefined

    keyFilter object optional

    Alternative 1: An array of strings defining a filter which property names to include.

    Alternative 2: An object with "include" and/or "exclude" keys

    {"exclude": ["key1", ...]}
    includes all but the listed properties, while
    {"include": ["key1", ...]}
    or
    ["key1", ...]
    includes only the listed properties.

    Non-optional properties are always included

    detailFilter object optional

    A filter to define the granularity of the JSON structure

    [ "schema" ]
    includes json with schema information

    Since:
    • 4.1.0
    Returns:
    Type Description
    Array.<object> The rendered objects

    renderExcel(elements, entity)

    Renders the elements as an Excel file

    Name Type Description
    elements Array.<$k.SemanticElement>

    The elements to render

    entity $k.NetEntity

    The render target

    Version:
    • Experimental feature, might be removed at any time
    Since:
    • 4.1.0

    renderJSON(elements, excludedKeys, detailFilter) : object

    Render the elements as a JSON object

    Name Type Description
    elements Array.<$k.SemanticElement>
    excludedKeys Array.<string> optional

    Collection of property names that are excluded

    detailFilter object optional

    A filter to define the granularity of the JSON structure

    [ "schema" ]
    includes json with schema information

    Deprecated
    • Use render(elements, {"exclude": excludedKeys}) instead
      Returns:
      Type Description
      object The rendered JSON object

      Find the elements by the given column values

      Name Type Description
      domain $k.Domain

      Domain or internal name of a type of the table

      filterDescriptions Array.<object>

      Column index/name and value

      disableInheritance boolean optional

      True if the query should only match direct instances/subtypes

      Since:
      • 4.1.0
      Throws:
      Type Description
      $k.exception.InvalidValue

      If the filter values are invalid

      $k.exception.MissingParameter

      If the filter value for a column is missing

      $k.exception.QueryError

      If filtering was not possible

      Returns:
      Type Description
      Array.<$k.SemanticElement>
      Example

      configuration.search([ {column: "dateOfBirth", value: "1970", operator: "less" }])

      setContext(contextObject) : $k.TableConfiguration

      Set the context object

      Name Type Description
      contextObject object

      Context object

      Since:
      • 4.1.0
      See:
      Returns:
      Type Description
      $k.TableConfiguration

      setQuery(query)

      Set the query that returns the table elements. Note that the query is part of the context and will be overwritten if the context is set with setContext()

      Name Type Description
      query $k.Query
      Since:
      • 4.1.0

      sort(semanticElements, sortDescriptions) : Array.<$k.SemanticElement>

      Returns the elements sorted by the given columns and sort orders

      Name Type Description
      semanticElements Array.<$k.SemanticElement>
      sortDescriptions Array.<object> optional

      Column index/name and optional sort order (ascending). The configured sort order is used if this parameter is undefined.

      Since:
      • 4.1.0
      Returns:
      Type Description
      Array.<$k.SemanticElement> The sorted elements
      Example

      configuration.sort(elements, [ {column: "familyName", ascending: false }, {column: "givenName" }])

      sortDescriptions() : Array.<object>

      Returns the configured sort descriptions of the table

      Since:
      • 4.1.0
      Returns:
      Type Description
      Array.<object>