Home Manual Reference Source
import Datatable from 'pvbid-sdk/src/domain/Datatable.js'
public class | source

Datatable

Extends:

eventemitter3~EventEmitterAdvanceEventEmitterBidEntity → Datatable

Datatable Class

Constructor Summary

Public Constructor
public

constructor(datatableData: object, bid: Bid)

Creates an instance of Datatable.

Member Summary

Public Members
public

bid: Bid

Reference to the bid that the datatable belongs to.

public get

Columns including any linked inventory data

public get

Gets the configuration information for the bid entity.

public get
this get was deprecated. Definition ids will become obsolete in planned data structure upgrade.

Gets the datatables's definition id.

public get

Currently linked inventory type

public get

Rows including any linked inventory data

Method Summary

Public Methods
public

Gets a list of bid entities that relies on the datatable instance.

public

dirty()

Flags the datatable and corresponding bid as dirty and to be saved.

public

exportData(alwaysIncludeConfig: boolean): object

Exports datatable to core structure.

public

findRowByExternalPartId(vendorName: string, vendorPartId: string | number): string | undefined

Find the first row in the datatable which has the given vendor part linked.

public

getColumnValues(columnId: string): object[]

Gets a list of column values.

public

Returns an array of the datatable row options based on the datatable key column.

public

getValue(columnId: string, rowId: string): string | number | boolean

Retrieves a cell value.

public

Determines if the datatable is has changed for it's original data.

public

async reload(): Promise<void>

Reload the datatable.

Inherited Summary

From class AdvanceEventEmitter
public

Maximum number of events fired for the requester before events stop.

public

on(eventName: string, requesterId: string, callback: function)

public

onDelay(eventName: string, ms: number, requesterId: string, callback: function)

public

removeListenerByRequester(eventName: string, requesterId: string)

Removes event listeners by event and requesterId.

From class BidEntity
public get

Determine if the entity is in an assembly

public get

Gets the id of the bid entity.

public get

Gets the bid entity title.

public set

Sets the bid entity title.

public get

Gets the bid entity type.

public abstract

assess(dependency: BidEntity)

Assesses bid entity.

public

Gets an array of depndants that rely on the bid entity.

public

Gets all the dependencies that the bid entity relies on.

public

dirty()

Flags the bid entity as dirty and to be saved.

public

Exports the internal data for the bid entity.

public

Determines if bid entity relies on a null or undefined dependency value

public

async initSaveChangeLog(originalValue: *, newValue: *, valueType: *, entityProperty: *, metaData: *): *

public

Determines of bid entity is dirty.

public

Marks the bid entity as clean.

Public Constructors

public constructor(datatableData: object, bid: Bid) source

Creates an instance of Datatable.

Override:

BidEntity#constructor

Params:

NameTypeAttributeDescription
datatableData object
bid Bid

Public Members

public bid: Bid source

Reference to the bid that the datatable belongs to.

public get columns: object source

Columns including any linked inventory data

public get config: object source

Gets the configuration information for the bid entity.

public get definitionId: number source

this get was deprecated. Definition ids will become obsolete in planned data structure upgrade.

Gets the datatables's definition id.

Currently linked inventory type

public get rows: object source

Rows including any linked inventory data

Public Methods

public dependants(): BidEntity[] source

Gets a list of bid entities that relies on the datatable instance.

Override:

BidEntity#dependants

Return:

BidEntity[]

public dirty() source

Flags the datatable and corresponding bid as dirty and to be saved.

Override:

BidEntity#dirty

public exportData(alwaysIncludeConfig: boolean): object source

Exports datatable to core structure.

Override:

BidEntity#exportData

Params:

NameTypeAttributeDescription
alwaysIncludeConfig boolean
  • optional
  • default: false

Will include config object in export regardless of changed status.

Return:

object

public findRowByExternalPartId(vendorName: string, vendorPartId: string | number): string | undefined source

Find the first row in the datatable which has the given vendor part linked.

Params:

NameTypeAttributeDescription
vendorName string
vendorPartId string | number

Return:

string | undefined

The row ID of the row containing the matching part. Undefined if none found.

public getColumnValues(columnId: string): object[] source

Gets a list of column values.

Params:

NameTypeAttributeDescription
columnId string

Return:

object[]

Return Properties:

NameTypeAttributeDescription
id string

The row id for the value.

value string | number | boolean
  • nullable: true

public getOptions(): object[] source

Returns an array of the datatable row options based on the datatable key column.

Return:

object[]

Return Properties:

NameTypeAttributeDescription
title string

The human readable title for the row. The title is from the key column.

row_id string

Contains the row id.

public getValue(columnId: string, rowId: string): string | number | boolean source

Retrieves a cell value.

Params:

NameTypeAttributeDescription
columnId string
rowId string

Return:

string | number | boolean (nullable: true)

public isDirty(): boolean source

Determines if the datatable is has changed for it's original data.

Override:

BidEntity#isDirty

Return:

boolean

public async reload(): Promise<void> source

Reload the datatable. Should be done any time an inventory link ID is updated.

Return:

Promise<void>