Interface ResultViewerService

Provides a service to show data tables in the ui.

The service can be injected by referencing "result-api.ResultViewerService".

Via the property currentDataTables the available data tables can be accessed.

const resultViewerService = ...;
const currentlyAvailableDataTables = resultViewerService.currentDataTables;

// with default result-ui only one of the tables are shown, to access this table use:
const firstDataTable = currentDataTables.getFirstSelectedTable();

// to iterate all available data tables use, for/of:
for (const dataTable of currentDataTables){
...
}

If you need an array of the tables use the `tables` property:
const tableArray = currentDataTables.tables;
// or
const tableArray = Array.from(currentDataTables);

It is possible to watch for the event current-data-changed:

const resultViewerService = ...;
resultViewerService.on("current-data-changed", ({shown, hidden})=>{
// shown is the new currentDataTables property
resultViewerService.currentDataTables === shown;
// hidden is the old replaced collection
resultViewerService.currentDataTables !== hidden;
})
interface ResultViewerService {
    currentDataTables: undefined | DataTableCollection;
    dataTableFactory: DataTableFactory;
    on<Name>(name, callBack): Handle;
    open(dataTables, options?): Handle;
}

Hierarchy

Properties

currentDataTables: undefined | DataTableCollection

As long as a ui is opened, the shown data can be accessed here. If a ui is closed or a new call to open is performed. The data will be replaced.

dataTableFactory: DataTableFactory

Provides access to a factory to assemble DataTables.

Methods

  • Registers event listener.

    Type Parameters

    • Name extends "current-data-changed"

    Parameters

    Returns Handle

  • Opens the given data tables in the UI and returns a handle that allows the caller to hide the model again.

    This method merges previously opened tables with the given dataTables by default. This behavior can be controlled by the given options object.

    Parameters

    Returns Handle

Generated using TypeDoc