API Docs for: 1.0.6
Show:

DataRelation Class

Defined in: src\jsDataSet.js:2363
Module: DataSet

creates a DataRelation

Constructor

DataRelation

(
  • relationName
  • parentTableName
  • parentColsName
  • childTableName
  • [childColsName=parentColsName]
)
DataRelation

Parameters:

Returns:

Methods

getChild

(
  • parentRow
)
ObjectRow[]

Get any child of a given ObjectRow following this DataRelation

Parameters:

Returns:

getChildFilter

(
  • parentRow
  • [alias]
)

Gets a filter that will be applied to the child table and will find any child row of a given ObjectRow

Parameters:

  • parentRow ObjectRow
  • [alias] String optional

    when present is used to attach an alias for the parent table in the composed filter

getParents

(
  • childRow
)
ObjectRow[]

Get any parent of a given ObjectRow following this DataRelation

Parameters:

Returns:

getParentsFilter

(
  • childRow
  • [alias]
)

Gets a filter that will be applied to the parent table and will find any parent row of a given ObjectRow

Parameters:

  • childRow Object
  • [alias] String optional

    when present is used to attach an alias for the parent table in the composed filter

isEntityRelation

() Boolean

Establish if a relation links the key of a table into a subset of another table key

Returns:

makeChild

(
  • parentRow
  • childRow
)

Modifies childRow in order to make it child of parentRow. Sets to null corresponding fields if parentRow is null or undefined

Parameters:

Returns:

:

Properties

childCols

String | String[]

Array of child column names or comma separated column names

childTable

String

Child table name

dataSet

DataSet

DataSet to which this DataRelation belongs to. It is used to retrieve parent and child table

parentCols

String | String[]

Array of parent column names or comma separated column names

parentTable

String

Parent table name