🛠️
Developer docs
Start BuildingGuides
  • ✨Getting Started
  • 🎛️Self Hosted Config
  • ✍️SSO Login
    • Saml Identity Provider (Idp)
    • Oidc Identity Provider (Idp)
  • 🎞️Framework Specific Guide
    • ⚛️Reactjs
    • ⚛️Nextjs
    • ⚛️Vuejs
    • ⚛️Angular
    • ⚛️Svelte
    • ⚛️Solid
    • ⚛️Vanilla JS
  • ℹ️Token
  • 🏛️Multi-Tenant Access Control
  • Embed using iFrame (Not Recommended approach)
  • 🔑License Key Validation for Self-Hosted App
  • Test
  • 👩‍💻Helpers
    • ✳️Token Body
    • ✅Options
      • Custom Fiscal Year filter setup in DataBrain
    • 🈂️Server Event
    • Embed Functions
    • Override Language
    • ✈️Embedding Architecture
    • ✈️LLM Architecture
    • ✨LLM Connectors
      • Open AI
      • Claude AI
      • Azure Open AI
      • Llama
      • Mixtral
    • 🆔Dashboard ID
    • 🆔Metric ID
    • 🆔API Token
    • 🆔End User Metric Creation
    • Embedding APIs
      • Sync Datasource
  • Metric App Filter
  • Dashboard App Filter
  • Chat Mode
    • Step 1: Create Datamart and Workspace
    • Step 2: Create Data App and Embed ID
  • ✨Solutions Alchemy
    • Dashboards for Client Groups
    • Dashboard for Multiple Clients
    • Embedding: Role based Dashboard Filtering
    • Localized Currency Symbols
    • Manage Metrics
Powered by GitBook
On this page
  1. Helpers

Server Event

It is a function prop that detects and retrieves error or loading occurring within dashboard component, facilitating timely resolution and enabling various automated tasks to be triggered in response.

To make use of 'handle-server-event ' in dbn-dashboard, you first need to define the function that you want to pass to this prop in the global object, here's an example:

window.databrainServerEvent = (code: string) => {
  if (code) {
    // do something
  }
}

To implement it in dbn-dashboard component:

<dbn-dashboard handle-server-event="databrainServerEvent" />

This will attatch the funtion to the dbn-dashboard component, fetching the error or loading status which you can handle in your app.

Below is the list of all the codes that you can get from dbn-dashboard:

  • TOKEN_EXPIRED

  • UNAUTHORIZED_ORIGIN

  • INVALID_TOKEN

  • INVALID_DASHBOARD_ID

  • IS_LOADING

  • DATA_LOADED

  • ENTER_FULL_SCREEN_MODE

  • EXIT_FULL_SCREEN_MODE

  • ENTER_SCHEDULED_REPORT_MODE

  • SAVE_SCHEDULED_REPORT

  • EXIT_SCHEDULED_REPORT_MODE

  • ENTER_CUSTOMIZE_LAYOUT_MODE

  • EXIT_CUSTOMIZE_LAYOUT_MODE

  • SAVE_LAYOUT

  • ENTER_MANAGE_METRICS_MODE

  • EXIT_MANAGE_METRICS_MODE

  • SAVE_MANAGE_METRICS

  • ARCHIVE_METRIC

  • DOWNLOAD_METRIC

  • DOWNLOAD_METRIC_WITHOUT_FILTERS

  • SAVE_METRIC_PNG

  • METRIC_FILTER_APPLIED

  • DASHBOARD_FILTER_APPLIED

NOTE: If you get error like Property 'functionName' does not exist on type 'Window & typeof globalThis', add the type of window as any.

PreviousCustom Fiscal Year filter setup in DataBrainNextEmbed Functions

Last updated 6 months ago

👩‍💻
🈂️