ActiveUI

ActiveUI

  • User Guide
  • Developer Documentation

Home > @activeviam/activeui-sdk > SelectedPageAware

SelectedPageAware() function

A Function As Child Component that provides the API and index of the active page of the currently selected dashboard.

Signature:

export declare function SelectedPageAware(props: SelectedPageAwareProps): JSX.Element;

Parameters

ParameterTypeDescription
propsSelectedPageAwareProps

Returns:

JSX.Element

Example

// Custom button to add an unconfigured Pivot Table to the active page of the selected dashboard
// The bookmark content should be adapted. This is just an example.

const unconfiguredPivotTableBookmark = {
 type: 'container',
 value: {
   body: {
     tabular: {
       hideAddButton: true,
       lineNumbers: true,
       statisticsShown: true,
     },
   },
   containerKey: 'pivot-table',
   showTitleBar: true,
 },
};

const AddPivotTableButton = () => (
 <SelectedPageAware>
   {selectedPageApi => (
     <Button
       onClick={() => {
         selectedPageApi
           .loadBookmarkRelativeTo(unconfiguredPivotTableBookmark, 0, 'right');
       }}
     >
       Add Pivot Table
     </Button>
   )}
 </SelectedPageAware>
);

  • SelectedPageAware() function
  • Parameters
  • Example
Copyright © 2023 ActiveViam