API Docs for: 1.0.6
Show:

DataRow Class

Defined in: src\jsDataSet.js:254
Module: DataRow
Parent Module: DataSet

Provides methods to manage objects as Ado.Net DataRows

Methods

_reset

() DataRow private

resets all change and sets state to unchanged

Returns:

acceptChanges

() DataRow

Makes changes permanents, discarding old values. state becomes unchanged, detached remains detached

Returns:

DataRow

(
  • o
)
DataRow

Creates a DataRow from a generic plain object, and returns the DataRow

Parameters:

  • o Object

    this is the main object managed by the application logic, it is attached to a getRow function

Returns:

del

() DataRow

Deletes the row. If it is in added state it becomes detached. Otherwise any changes are lost, and only rejectChanges can bring the row into life again

Returns:

detach

() Undefined

Detaches row, loosing all changes made. object is also removed from the underlying DataTable. Proxy is disposed.

Returns:

Undefined:

getChildInTable

(
  • childTableName
)
ObjectRow[]

Gets child rows of this row in a given table

Parameters:

Returns:

getChildRows

(
  • relName
)
ObjectRow[]

Gets the child(s) of this row in the dataSet it is contained, following the relation with the specified name

Parameters:

Returns:

getParentRows

(
  • relName
)
ObjectRow[]

Gets the parent(s) of this row in the dataSet it is contained, following the relation with the specified name

Parameters:

Returns:

getParentsInTable

(
  • parentTableName
)
ObjectRow[]

Gets parents row of this row in a given table

Parameters:

Returns:

getValue

(
  • fieldName
  • [dataRowVer='current']
)
Object

get the value of a field of the object. If dataRowVer is omitted, it's equivalent to o.fieldName

Parameters:

  • fieldName String
  • [dataRowVer='current'] DataRowVersion optional

    possible values are 'original', 'current'

Returns:

keySample

() Object

Get an object with all key fields of this row

Returns:

makeEqualTo

(
  • o
)
DataRow

changes current row to make it's current values equal to another one. Deleted rows becomes modified compared to patchTo, this also removes values that are not present in other row

Parameters:

Returns:

originalRow

() Object

Gets the original row, before changes was made, undefined if current state is added

Returns:

patchTo

(
  • o
)
DataRow

changes current row to make it's current values equal to another one. Deleted rows becomes modified

Parameters:

Returns:

rejectChanges

() DataRow

Discard changes, restoring the original values of the object. state becomes unchanged, detached remains detached

Returns:

toString

() String

Debug - helper function

Returns:

Properties

added

Object

fields added to object (after last acceptChanges())

current current value of the DataRow is the ObjectRow attached to it

ObjectRow public

old

Object

previous values of the DataRow, only previous values of changed fields are stored

removed

Object

fields removed (with delete o.field) from object (after last acceptChanges())

state

DataRowState public

State of the DataRow, possible values are added unchanged modified deleted detached

table

DataTable public

table

DataTable

DataTable that contains this DataRow