Skip to main content
Hitachi Vantara Lumada and Pentaho Documentation

Event APIs

api.event Class

The event system definition for api class. Contains all necessary calls for creating and registering Events

Methods

registerActionEventListener (listener) Event

Registers a listener which runs after report actions and before refresh report. For more information, see Analyzer Event Registration.

Parameters:

  • listener (Function)

    This is the listener function which is executed after report actions and before refresh report.

Returns:

  • Event

    This is the object which allows you to remove the listener after registration.

Example:

api.event.registerActionEventListener(function(e, api, actionCode, actionCtx) {
  //Perform Action on api.*
  e.preventDefault();
  e.stopImmediatePropagation();
});

registerBuildMenuListener (listener) Event

Registers a listener which runs before showing any of the menus in Analyzer.

Parameters:

  • listener (Function)

    This is the listener function which runs before showing any of the menus in Analyzer.

Returns:

  • Event

    This is the object which allows you to remove the listener after registration.

Example:

api.event.registerBuildMenuListener(function(e, api, menuId, menu, x, y){
  //Perform Action on api.*
  e.preventDefault();
  e.stopImmediatePropagation();
});

registerChartDoubleClickListener (listener) Event

Registers a listener which runs when double-clicking on a chart item in Analyzer.

Parameters:

  • listener (Function)

    This is the listener function which is executed when double-clicking a chart item.

Returns:

  • Event

    This is the object which allows you to remove the listener after registration.

Example:

api.event.registerChartDoubleClickListener(function(e, api, ctx){
  //Perform Action on api.*
  e.preventDefault();
  e.stopImmediatePropagation();
});

registerChartSelectItemsListener (listener) Event

Registers a listener which runs when a user selects a chart data point or lassos a collection of data points. The listener can also run when the user clears chart items by clicking on the selected chart item or by clicking the Clear Selections button.

Parameters:

  • listener (Function)

    This is the listener function which is executed when a user selects a chart data point or lassos a collection of data points.

Returns:

  • Event

    This is the object which allows you to remove the listener after registration.

Example:

api.event.registerChartSelectItemsListener(function(e, api, ctx[]){
  //Perform Action on api.*
  e.stopImmediatePropagation();
});

registerDragEventListener (listener) Event

Registers a listener which runs when a user starts dragging an object in the report area, layout panel, or available fields.

Parameters:

  • listener (Function)

    This is the listener function which is executed after a drag has occurred.

Returns:

  • Event

    This is the object which allows you to remove the listener after registration.

Example:

api.event.registerDragEventListener(function(e, api, formula){
  //Perform Action on api.*
  e.stopImmediatePropagation();
});

registerDropEventListener (listener) Event

Registers a listener which runs after a drop has occurred in the report area, filter area, trash can, or layout panel.

Parameters:

  • listener (Function)

    This is the listener function which is executed after a drop has occurred.

Returns:

  • Event

    This is the object which allows you to remove the listener after registration.

Example:

api.event.registerDropEventListener(function(e, api, formula, dropClass){
  //Perform Action on api.*
  e.stopImmediatePropagation();
});

registerInitListener (listener)

Registers a listener which runs during the initialization of Analyzer. For more information, see Analyzer Event Registration.

Parameters:

  • listener (Function)

    This is the listener function which is executed during the initialization.

Returns:

  • Event

This is the object which allows you to remove the listener after registration.

Example:

api.event.registerInitListener( function( e, cv ) ) {
  //Perform Action on cv.api.*
  e.stopImmediatePropagation();
});

registerPostExecutionListener (listener) Event

Registers a listener which is called after the report has completely finished executing in Mondrian and the server has returned with either an HTML or JSON result, depending on the visualization type.

Parameters:

  • listener (Function)

    This is the listener function which is called after the report has completely finished executing.

Returns:

  • Event

    This is the object which allows you to remove the listener after registration.

Example:

api.event.registerPostExecutionListener(function(e, api, message){
  //Perform Action on api.*
  e.preventDefault();
  e.stopImmediatePropagation();
});

registerPreExecutionListener (listener) Event

Registers a listener which is called just before the browser sends the report XML to the server for processing.

Parameters:

  • listener (Function)

    This is the listener function which runs before a report is run.

Returns:

  • Event

    This is the object which allows you to remove the listener after registration.

Example:

api.event.registerPreExecutionListener(function(e, api){
  //Perform Action on api.*
  e.preventDefault();
  e.stopImmediatePropagation();
});

registerRenderListener (listener) Event

Registers a listener which runs after the UI has drawn the visualization. For more information, see Analyzer Event Registration.

Parameters:

  • listener (Function)

    This is the listener function which is executed after the UI has drawn the visualization.

Returns:

  • Event

    This is the object which allows you to remove the listener after registration.

Example:

api.event.registerRenderListener(function(e, api, reportArea) {
  //Perform Action on api.*
  e.stopImmediatePropagation();
});

registerTableClickListener (listener) Event

Registers a listener which runs when clicking on a table cell in Analyzer. For more information, see Analyzer Event Registration.

Parameters:

  • listener (Function)

    This is the listener function which is executed when clicking on a table cell in Analyzer.

Returns:

  • Event

    This is the object which allows you to remove the listener after registration.

Example:

api.event.registerTableClickListener(function(e, api, td, ctx, filterCtx) {
  //Perform Action on api.*
  e.preventDefault();
  e.stopImmediatePropagation();
});

registerTableContextMenuListener (listener) Event

Registers a listener which runs when a context menu is open on a table cell in Analyzer. For more information, see Analyzer Event Registration.

Parameters:

  • listener (Function)

    This is the listener function which is executed when a context menu is open on a table cell in Analyzer.

Returns:

  • Event

    This is the object which allows you to remove the listener after registration.

Example:

api.event.registerTableContextMenuListener(function(e, api, td, ctx, filterCtx) {
  //Perform Action on api.*
  e.preventDefault();
  e.stopImmediatePropagation();
});

registerTableDoubleClickListener (listener) Event

Registers a listener which runs when double-clicking on a table cell in Analyzer.

Parameters:

  • listener (Function)

    This is the listener function which is executed when double-clicking on a table cell.

Returns:

  • Event

    This is the object which allows you to remove the listener after registration.

Example:

api.event.registerTableDoubleClickListener(function(e, api, td, ctx, filterCtx){
  //Perform Action on api.*
  e.preventDefault();
  e.stopImmediatePropagation();
});

registerTableMouseMoveListener (listener) Event

Registers a listener which runs when a user moves the mouse cursor across any table cell in Analyzer.

Parameters:

  • listener (Function)

    This is the listener function which is executed when a user moves the mouse cursor across any table cell in Analyzer.

Returns:

  • Event

    This is the object which allows you to remove the listener after registration.

Example:

api.event.registerTableMouseMoveListener(function(e, api, td, ctx, filterCtx){
  //Perform Action on api.*
  e.preventDefault();
  e.stopImmediatePropagation();
});

registerTableMouseOverListener (listener) Event

Registers a listener which runs when a user positions the mouse cursor over any table cell in Analyzer.

Parameters:

  • listener (Function)

    This is the listener function which is executed when a user positions the mouse cursor over any table cell in Analyzer.

Returns:

  • Event

    This is the object which allows you to remove the listener after registration.

Example:

api.event.registerTableMouseOverListener(function(e, api, td, ctx, filterCtx){
  //Perform Action on api.*
  e.preventDefault();
  e.stopImmediatePropagation();
});