API Docs for: 1.0.6
Show:

DataSet Class

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

Stores and manages a set of DataTables and DataRelations

Methods

acceptChanges

()

Calls acceptChanges to all contained DataTables

addTable

(
  • table
)
DataTable

Adds a datatable to DataSet

Parameters:

Returns:

cascadeDelete

(
  • row
)

Deletes a row with all subentity child

Parameters:

Returns:

:

clone

() DataSet

Clones a DataSet replicating its structure but without copying any ObjectRow

Returns:

copy

() DataSet

Creates a copy of the DataSet, including both structure and data.

Returns:

DataSet

(
  • dataSetName
)
DataSet

Creates an empty DataSet

Parameters:

Returns:

deSerialize

(
  • d
  • deSerializeStructure
)

Restores data from an object obtained with serialize().

Parameters:

hasChanges

() Boolean

Check if any contained DataTable has any changes

Returns:

importData

(
  • d
)

Import data from a given dataset

Parameters:

mergeAsPatch

(
  • d
)

merges changes from DataSet d assuming they are unchanged and they are all present in this dataset. Rows are updated, but only fields actually present in d are modified. Other field are left unchanged. It is assumed that "this" dataset is unchanged at the beginning

Parameters:

mergeAsPost

(
  • d
)

merges changes from DataSet d assuming they are unchanged and they are not present in this dataset. Rows are all added 'as is' to this, in the state of ADDED It is assumed that "this" dataset is unchanged at the beginning

Parameters:

mergeAsPut

(
  • d
)

merges changes from DataSet d assuming they are unchanged and they can be present in this or not. If a row is not present, it is added. If it is present, it is updated. It is assumed that "this" dataset is unchanged at the beginning

Parameters:

newRelation

(
  • relationName
  • parentTableName
  • parentColsName
  • childTableName
  • childColsName
)
DataRelation

Creates a new DataRelation and attaches it to the DataSet

Parameters:

Returns:

newTable

(
  • tableName
)
DataTable

Creates a new DataTable attaching it to the DataSet

Parameters:

Returns:

rejectChanges

()

Calls rejectChanges to all contained DataTables

serialize

(
  • [serializeStructure=false]
  • [filterRow]
)
Object

Creates a serializable version of this DataSet

Parameters:

  • [serializeStructure=false] Boolean optional

    when true serialized also structure, when false only row data

  • [filterRow] Function optional

    function to select which rows have to be serialized

Returns:

Properties

name

Unknown

DataSet name

optimisticLocking

OptimisticLocking

DataSet - level optimistic locking, this property is set in custom implementations

} relationsByChild

DataRelation[]

Gets all relations where the child table is the key of the hash relationsByChild['a'] is an array of all DataRelations where 'a' is the child

} relations

DataRelation

Collection of DataRelation where relations[relName] is a DataRelation named relName

} relationsByParent

DataRelation[]

Gets all relations where the parent table is the key of the hash relationsByParent['a'] is an array of all DataRelations where 'a' is the parent

} tables

DataTable public

Collection of DataTable where tables[tableName] is a DataTable named tableName