$k. TableConfiguration

new TableConfiguration()

Configuration of a table

Extends

Methods

(static) forDomain(domain, contextopt) → {$k.TableConfiguration}

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

Parameters:
NameTypeAttributesDescription
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: 
$k.TableConfiguration

(static) from(configurationElement) → {$k.TableConfiguration}

Returns the confguration defined by the element

Parameters:
NameTypeDescription
configurationElement$k.SemanticElement

The configuration element

Since
  • 4.1.0
Returns:
Type: 
$k.TableConfiguration

columns(domain, contextObjectopt) → {object}

Returns the columns of the table

Parameters:
NameTypeAttributesDescription
domain$k.Domain

Domain or internal name of a type of the table

contextObjectobject<optional>

JSON render context object

Since
  • 4.1.0
Deprecated
  • This function is deprecated and might be removed in future releases
Returns:
Type: 
object

configElement() → {$k.SemanticElement}

Since
  • 4.1.0
Returns:
Type: 
$k.SemanticElement

createFilterProperties(element)

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

Parameters:
NameTypeDescription
element$k.SemanticElement
Version
  • Experimental feature, might be removed at any time
Since
  • 4.1.0

elements(elementsOrQueryopt) → {Array.<$k.SemanticElement>}

Returns the filtered, sorted and paged elements of this table

Parameters:
NameTypeAttributesDescription
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)

Since
  • 4.2.0
Returns:

The filtered, sorted and paged elements

Type: 
Array.<$k.SemanticElement>

filter(elements, filterDescriptions, disableInheritanceopt) → {Array.<$k.SemanticElement>}

Filters the elements by the given column values

Parameters:
NameTypeAttributesDescription
elementsArray.<$k.SemanticElement>
filterDescriptionsArray.<object>

Column index/name and value: {column: indexOrName, value: "", operator: "".

Operator is one of: "containsPhrase", "covers", "distance", "equal" (or "=="), "equalBy", "equalCardinality", "equalGeo", "equalMaxCardinality", "equalMinCardinality", "equalPresentTime", "equalsTopicOneWay", "fulltext", "greater" (or ">"), "greaterOrEqual" (or ">="), "greaterOverlaps", "greaterPresentTime", "isCoveredBy", "less" (or "<"), "lessOrEqual" (or "<="), "lessOverlaps", "lessPresentTime", "notEqual" (or "!="), "overlaps", "range", "regexEqual", "regexFulltext", "unmodifiedEqual", "words"

disableInheritanceboolean<optional>

True if the query should only match direct instances/subtypes

Since
  • 4.1.0
Throws:
Returns:

The filtered elements

Type: 
Array.<$k.SemanticElement>
Example
configuration.filter(elements, [ {column: "familyName", value: "Doe" }]) 

render(elementsopt, keyFilteropt, detailFilteropt) → {Array.<object>}

Renders the elements as literal objects

Parameters:
NameTypeAttributesDescription
elements<optional>

Elements, query or undefined

keyFilterobject<optional>

Alternative 1 (preferred): a $k.JSONRenderContext Alternative 2 (compatibility only): A filter. See $k.JSONRenderContext.prototype.setFilters().

detailFilterobject<optional>

Only used if the key filter is not a $k.JSONRenderContext. See $k.JSONRenderContext.prototype.setLevelsOfDetail()

Since
  • 4.1.0
Deprecated
  • This function is deprecated and might be removed in future releases
Returns:

The rendered objects

Type: 
Array.<object>

renderExcel(elements, entity, templateopt, conversionopt, variablesopt)

Renders the elements as an Excel file

Parameters:
NameTypeAttributesDescription
elementsArray.<$k.SemanticElement>

The elements to render

entity$k.NetEntity

The render target

template$k.Instance<optional>

List template

conversion$k.SemanticElement<optional>

The semantic element representing the document conversion

variablesobject<optional>

Additional variables to pass to the template

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

When the elements could not be rendered

Type
$k.exception.RuntimeError

Find the elements by the given column values

Parameters:
NameTypeAttributesDescription
domain$k.Domain

Domain or internal name of a type of the table

filterDescriptionsArray.<object>

Column index/name and value: {column: indexOrName, value: "", operator: "".

Operator is one of: "containsPhrase", "covers", "distance", "equal" (or "=="), "equalBy", "equalCardinality", "equalGeo", "equalMaxCardinality", "equalMinCardinality", "equalPresentTime", "equalsTopicOneWay", "fulltext", "greater" (or ">"), "greaterOrEqual" (or ">="), "greaterOverlaps", "greaterPresentTime", "isCoveredBy", "less" (or "<"), "lessOrEqual" (or "<="), "lessOverlaps", "lessPresentTime", "notEqual" (or "!="), "overlaps", "range", "regexEqual", "regexFulltext", "unmodifiedEqual", "words"

disableInheritanceboolean<optional>

True if the query should only match direct instances/subtypes

Since
  • 4.1.0
Throws:
Returns:
Type: 
Array.<$k.SemanticElement>
Example
configuration.search([ {column: "dateOfBirth", value: "1970", operator: "less" }]) 

setContext(contextObject) → {$k.TableConfiguration}

Set the context object

Parameters:
NameTypeDescription
contextObjectobject

Context object

Since
  • 4.1.0
Deprecated
  • This function is deprecated and might be removed in future releases
Returns:
Type: 
$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()

Parameters:
NameTypeDescription
query$k.Query
Since
  • 4.1.0

setRenderContext(renderContextObject)

Set render context

Parameters:
NameTypeDescription
renderContextObjectRenderContext
Since
  • 5.3.0
Deprecated
  • This function is deprecated and might be removed in future releases

sort(semanticElements, sortDescriptionsopt) → {Array.<$k.SemanticElement>}

Returns the elements sorted by the given columns and sort orders

Parameters:
NameTypeAttributesDescription
semanticElementsArray.<$k.SemanticElement>
sortDescriptionsArray.<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:

The sorted elements

Type: 
Array.<$k.SemanticElement>
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
Deprecated
  • This function is deprecated and might be removed in future releases
Returns:
Type: 
Array.<object>

toJSON()

Deprecated
  • This function is deprecated and might be removed in future releases