RevGrid - v0.10.0
    Preparing search index...

    Interface used by client to get data from a server or update values

    interface RevDataServer<SF extends RevSchemaField> {
        getCursorName(field: SF, rowIndex: number): string;
        getEditValue(field: SF, rowIndex: number): unknown;
        getRowCount(): number;
        getRowIdFromIndex(subgridRowIndex: number): unknown;
        getRowIndexFromId(rowId: unknown): undefined | number;
        getTitleText(field: SF, rowIndex: number): string;
        getViewData(): readonly ViewRow[];
        getViewRow(subgridRowIndex: number): ViewRow;
        getViewValue(field: SF, rowIndex: number): unknown;
        setEditValue(field: SF, rowIndex: number, value: unknown): void;
        subscribeDataNotifications(client: RevDataServer.NotificationsClient): void;
        unsubscribeDataNotifications(
            client: RevDataServer.NotificationsClient,
        ): void;
    }

    Type Parameters

    Implemented by

    Index

    Methods

    • Cursor to be displayed when mouse hovers over cell containing data point

      Parameters

      • field: SF
      • rowIndex: number

      Returns string

    • Get a field's value at the specified row in a format suitable for editing.

      This function only needs to be implemented if cells can be edited. See RevCellEditor for more information about editing data. The core of the client does not need to know the type of the return value. getEditValue() is called by the Cell Editor associated with the cell. A cell editor expects a certain type of view value and casts the result accordingly.

      Parameters

      • field: SF

        The field from which to get the value

      • rowIndex: number

        The index of the row from which to get the value

      Returns unknown

    • Gets current count of rows in the associated subgrid at the server.

      Returns number

    • Gets a unique identifier for a row which is not affected by sorting, filtering or reordering.

      This optional method needs to be implemented for selection and focus to be preserved across row sorting, filtering and reordering.

      Parameters

      • subgridRowIndex: number

        Subgrid row index.

      Returns unknown

    • Gets the current subgrid row index of a row from a row identifier.

      This optional method does not need to be implemented for selection and focus to be preserved row across sorting, filtering and reordering however, if implemented, it will make restoring focus and selection more efficient.

      Parameters

      Returns undefined | number

    • Title text to be displayed when mouse hovers over cell containing data point

      Parameters

      • field: SF
      • rowIndex: number

      Returns string

    • Get a row of data from the server.

      If this method is implemented, it allows the client to retrieve an entire row of data from the server instead of having to retrieve the value each cell in the row individually. Used by RevSubgridImplementation.getSingletonViewDataRow.

      Parameters

      • subgridRowIndex: number

        Subgrid row index.

      Returns ViewRow

    • Get a field's value at the specified row in a format suitable for display.

      The core of the client does not need to know the type of the return value. getViewValue() is called by the Cell Painter associated with the cell/subgrid. The cell painter expects a certain type of view value and casts the result accordingly.

      Parameters

      • field: SF

        The field from which to get the value

      • rowIndex: number

        The index of the row from which to get the value

      Returns unknown

      The value of the field at the specified row.

    • Set a cell's value given its column schema & row indexes and a new value.

      If not implemented, the cell cannot be edited.

      Parameters

      • field: SF
      • rowIndex: number
      • value: unknown

      Returns void