Interface TotalsTable

Behaves like a Table, but doesn't expose all of its API for changing the internal state. Instead, state is driven by the upstream table - when it changes handle, this listens and updates its own handle accordingly.

Additionally, this is automatically subscribed to its one and only row, across all columns.

A new config is returned any time it is accessed, to prevent accidental mutation, and to allow it to be used as a template when fetching a new totals table, or changing the totals table in use.

A simplistic Table, providing access to aggregation of the table it is sourced from. This table is always automatically subscribed to its parent, and adopts changes automatically from it. This class has limited methods found on Table. Instances of this type always have a size of one when no groupBy is set on the config, but may potentially contain as few as zero rows, or as many as the parent table if each row gets its own group.

When using the groupBy feature, it may be desireable to also provide a row to the user with all values across all rows. To achieve this, request the same Totals Table again, but remove the groupBy setting.

Hierarchy

Accessors

  • get columns(): Column[]
  • The columns present on this table. Note that this may not include all columns in the parent table, and in cases where a given column has more than one aggregation applied, the column name will have a suffix indicating the aggregation used. This suffixed name will be of the form columnName + '__' + aggregationName.

    Returns Column[]

    Column array

  • get customColumns(): CustomColumn[]
  • Read-only. An ordered list of custom column formulas to add to the table, either adding new columns or replacing existing ones. To update, call applyCustomColumns().

    Returns CustomColumn[]

    CustomColumn array

  • get filter(): FilterCondition[]
  • An ordered list of Filters to apply to the table. To update, call applyFilter(). Note that this getter will return the new value immediately, even though it may take a little time to update on the server. You may listen for the filterchanged event to know when to update the UI.

    Returns FilterCondition[]

    FilterCondition array

  • get isClosed(): boolean
  • True if this table has been closed.

    Returns boolean

    boolean

  • get isRefreshing(): boolean
  • True if this table may receive updates from the server, including size changed events, updated events after initial snapshot.

    Returns boolean

    boolean

  • get size(): number
  • The total number of rows in this table. This may change as the base table's configuration, filter, or contents change.

    Returns number

    double

  • get sort(): Sort[]
  • An ordered list of Sorts to apply to the table. To update, call applySort(). Note that this getter will return the new value immediately, even though it may take a little time to update on the server. You may listen for the sortchanged event to know when to update the UI.

    Returns Sort[]

    Sort array

Methods

  • Type Parameters

    • T

    Parameters

    • name: string
    • callback: ((e) => void)
        • (e): void
        • Parameters

          • e: CustomEvent<T>

          Returns void

    Returns (() => void)

      • (): void
      • Returns void

  • Replace the current custom columns with a new set. These columns can be used when adding new filter and sort operations to the table, as long as they are present.

    Parameters

    Returns CustomColumn[]

  • Replace the currently set filters on the table. Returns the previously set value. Note that the filter property will immediately return the new value, but you may receive update events using the old filter before the new one is applied, and the filterchanged event fires. Reusing existing, applied filters may enable this to perform better on the server. The updated event will also fire, but rowadded and rowremoved will not.

    Parameters

    Returns FilterCondition[]

    FilterCondition array

  • Replace the currently set sort on this table. Returns the previously set value. Note that the sort property will immediately return the new value, but you may receive update events using the old sort before the new sort is applied, and the sortchanged event fires. Reusing existing, applied sorts may enable this to perform better on the server. The updated event will also fire, but rowadded and rowremoved will not.

    Parameters

    Returns Sort[]

    Sort array

  • Parameters

    • rightTable: JoinableTable
    • columnsToMatch: string[]
    • Optional columnsToAdd: string[]
    • Optional asOfMatchRule: string

    Returns Promise<Table>

  • Indicates that the table will no longer be used, and resources used to provide it can be freed up on the server.

    Returns void

  • Parameters

    • rightTable: JoinableTable
    • columnsToMatch: string[]
    • Optional columnsToAdd: string[]
    • Optional reserve_bits: number

    Returns Promise<Table>

  • Parameters

    • rightTable: JoinableTable
    • columnsToMatch: string[]
    • Optional columnsToAdd: string[]

    Returns Promise<Table>

  • a column by the given name. You should prefer to always retrieve a new Column instance instead of caching a returned value.

    Parameters

    • key: string

    Returns Column

    Column

  • multiple columns specified by the given names.

    Parameters

    • keys: string[]

    Returns Column[]

    Column array

  • the currently visible viewport. If the current set of operations has not yet resulted in data, it will not resolve until that data is ready.

    Returns Promise<TableData>

    Promise of TableData

  • Parameters

    • name: string

    Returns boolean

  • Parameters

    • joinType: object
    • rightTable: JoinableTable
    • columnsToMatch: string[]
    • Optional columnsToAdd: string[]
    • Optional asOfMatchRule: object

    Returns Promise<Table>

    Deprecated

  • Type Parameters

    • T

    Parameters

    • eventName: string
    • timeoutInMillis: number

    Returns Promise<CustomEvent<T>>

  • Type Parameters

    • T

    Parameters

    • name: string
    • callback: ((e) => void)
        • (e): void
        • Parameters

          • e: CustomEvent<T>

          Returns void

    Returns boolean

  • Specifies the range of items to pass to the client and update as they change. If the columns parameter is not provided, all columns will be used. Until this is called, no data will be available. Invoking this will result in events to be fired once data becomes available, starting with an updated event and one rowadded event per row in that range.

    Parameters

    • firstRow: number
    • lastRow: number
    • Optional columns: Column[]
    • Optional updateIntervalMs: number

    Returns void

  • Parameters

    • baseTable: Table
    • Optional doInitialSnapshot: boolean
    • Optional stampColumns: string[]

    Returns Promise<Table>