Version 1
Common Interface IDataManager GrapeCity DataViewsJS Interface

IDataManager Interface

Defines data manager that preprocess data according to specified grouping/filtering/sorting configurations.

Heirarchy

  • IDataManager

Properties

expandedItemCount

expandedItemCount: number

The expanded item count.

filterDescriptors

filterDescriptors: IFilterDescriptor[]

Specifies an array of filter descriptors

filterExpression

filterExpression: string | Function

The formula string applied to the filter.

groupDescriptors

groupDescriptors: IGroupDescriptor[]

Specifies an array of group descriptors

groups

An array of data manager groups in the first level in the group tree.

hierarchyDescriptor

hierarchyDescriptor: IHierarchyDescriptor

Specifies hierarchy descriptor

isHierarchical

isHierarchical: boolean

A flag that indicates whether the collection is hierarchical.

itemCount

itemCount: number

Returns total number of visible data rows.

nodes

An array of data manager nodes in the first level in the node tree.

rootGroup

A root group that contains the group tree.

rootNode

A root node that contains the node tree.

sortDescriptors

sortDescriptors: ISortDescriptor[]

Specifies an array of sort descriptors

sourceCollection

sourceCollection: any[]

The data source array.

Methods

addCalculatedColumn

  • addCalculatedColumn(name: string, formula: string): void
  • Adds calculated column

    Parameters

    • name: string

      The name of new column

    • formula: string

      The formula of the calculated column

    Returns void

addCalculatedField

  • addCalculatedField(name: string, formula: string): void
  • Adds a calculated field to the collection

    Parameters

    • name: string

      The name of the calculated field

    • formula: string

      The formula of the calculated field

    Returns void

addDataColumn

  • addDataColumn(name: string, dataField: string): void
  • Adds data column

    Parameters

    • name: string

      The name of new column

    • dataField: string

      The name of data field

    Returns void

editCalculatedColumn

  • editCalculatedColumn(column: string, newFormula: string): void
  • Sets a new formula in the specified calculated column.

    Parameters

    • column: string

      The name of the calculated column.

    • newFormula: string

      The string of the new formula.

    Returns void

editCalculatedField

  • editCalculatedField(name: string, newFormula: string): void
  • Sets a new formula in the specified calculated field.

    Parameters

    • name: string

      The name of the calculated field.

    • newFormula: string

      The string of the new formula.

    Returns void

evaluate

  • evaluate(formula: string, groupPath?: number[], hierarchyPath?: number[], srcRow?: number): any
  • Evaluates the formula with the specified evaluate context.

    Parameters

    • formula: string

      The formula to be evaluated.

    • Optional groupPath: number[]

      The group path as the evaluating context.

    • Optional hierarchyPath: number[]

      The hierarchy path as the evaluating context.

    • Optional srcRow: number

      The index of source row.

    Returns any

getCalculatedColumnValues

  • getCalculatedColumnValues(name: string): any[]
  • Gets an array that contains all the calculated results of the specified calculated column.

    Parameters

    • name: string

      The name of the calculated column.

    Returns any[]

getCalculatedFieldValue

  • getCalculatedFieldValue(name: string): any
  • Gets the value of a specified calculated field.

    Parameters

    • name: string

      The name of the calculated field.

    Returns any

getGroup

  • Gets the child group path.

    Parameters

    • groupPath: number[]

      An array which indicate the path of the group.

    Returns IDataManagerGroup

getItem

  • getItem(viewIndex: number, getAllInGroup?: boolean, getAllInTree?: boolean): IDataItem
  • Gets the row item object at the specified view row index.

    Parameters

    • viewIndex: number

      The row index in the view.

    • Optional getAllInGroup: boolean

      If false, item in collapsed group is not counted.

    • Optional getAllInTree: boolean

      If false, item in collapsed tree node is not counted.

    Returns IDataItem

getItems

  • getItems(): IDataItem[]
  • Gets all the view items in the collection.

    Returns IDataItem[]

getNode

  • Gets the child group or node by path.

    Parameters

    • groupPath: number[]

      An array which indicate the path of the group.

    • Optional nodePath: number[]

      An array which indicate the path of the node.

    Returns IDataManagerNode | IDataManagerGroup

insertDataItems

  • insertDataItems(dataItems: any, insertAt?: number): void
  • Adds new data items to the source collection at the specified row index in the source, and refreshes the data manager.

    Parameters

    • dataItems: any

      An Object or an array of objects which are new data items.

    • Optional insertAt: number

      The row index in the data source to add. The default is the last one.

    Returns void

isCalculatedColumn

  • isCalculatedColumn(column: string): boolean
  • Checks whether the column is an existing calculated column.

    Parameters

    • column: string

      The column name to test.

    Returns boolean

removeCalculatedColumn

  • removeCalculatedColumn(name: string): void
  • Remove specified calculated column

    Parameters

    • name: string

      The name of calculated column to remove

    Returns void

removeCalculatedField

  • removeCalculatedField(name: string): void
  • Removes the calculated field from the collection.

    Parameters

    • name: string

      The name of the calculated field to be removed.

    Returns void

removeDataItems

  • removeDataItems(removeAt: number, count?: number): void
  • Removes data items from the source collection at the specified source row index.

    Parameters

    • removeAt: number

      The row index in the source collection.

    • Optional count: number

      Number of row to remove.

    Returns void

updateItem

  • updateItem(sourceIndex: number, newItem: any): void
  • Update one item at the specific index.

    Parameters

    • sourceIndex: number

      The source index

    • newItem: any

      The new object which will replace the old one.

    Returns void