Mashmatrix Sheet
English
English
  • Mashmatrix Sheet User Guide
  • Introduction
  • Application Overview
  • Basic Usage
  • Functions about Books / Sheets
    • Create a New Book
    • Change Book Setting
    • Duplicate Book
    • Delete Book
    • Open Book in New Tab
    • Change Book Sharing Folder
    • Split Book Screen
    • Create a New Sheet
    • Change Tab Display Order of Sheets
    • Change Sheet Setting
      • Sheet Setting - Basic
      • Sheet Setting - Options
      • Sheet Setting - Filter
      • Sheet Setting - Actions
    • Maximize Sheet
    • Duplicate Sheet
    • Delete Sheet
    • Create a Related Sheet
    • Create a Card Type Sheet
    • Change Card Type Sheet Setting
    • Configure Views
    • Configure Search Form
  • Functions about Displaying Data
    • Change Columns Order
    • Change Column Width / Height
    • Fix Column from Scrolling
    • Sort
    • Filter
    • Change Column Setting
      • Column Setting - Basic Property
      • Column Setting - Options
      • Column Setting - Format
    • Show / Hide Column
    • Add Column
    • Delete Column
    • Group Column Headers
    • Summary Row
    • Formula
    • Function
      • Salesforce Compatible Functions
      • Aggregation Functions
      • Other Extension Functions
    • Reference Value
    • Navigate Pages and Reload Records
  • Functions about Editing Data
    • Edit / Save Displayed Data
    • Copy & Paste Values
    • Create a New Record
    • Duplicate Records
    • Delete Records
    • Lookup Search
  • Functions about Actions
    • Action Button
    • Standard Actions
    • Marketing Actions
    • Custom Actions
    • Approval Request Actions
  • Functions for Advanced Usage
    • Time-Series Matrix Transformation
      • Overview
      • Add Matrix Column
      • Change Matrix Column Setting
      • Show / Hide Column
      • Add Child Column
      • Delete Child Column
      • Format
      • Matrix Column and Formula
      • Limitations
  • Settings for Admin
    • Assign License
    • Grant Permission Set
    • Administration Console
    • Organization-Level Configuration
  • Customization
    • Access Sheet Directly with URL
    • Sheet Component
    • Embed Sheet in Layout using Visualforce
    • Using Sheet Component in Visualforce
    • JavaScript API
    • Launching Custom Apex / Visualforce
    • Launching Flow
    • Using in Experience Cloud
Powered by GitBook
On this page
  • API Methods
  • setApplicationParameter(params, options)
  • updateApplicationParameter(params, options)
  • subscribeComponentEvent(compId, path, event, listener)
  • unsubscribeComponentEvent(compId, path, event, listener)
  • Event Types
  • selectRecords
  • loadComplete
  • focusCell
  1. Customization

JavaScript API

PreviousUsing Sheet Component in VisualforceNextLaunching Custom Apex / Visualforce

Last updated 3 years ago

Placing the SheetView component on a Visualforce page globally exposes the MsmxSheet JavaScript object in the page. By making an API call from this object, it is possible to dynamically control Sheet's behavior and rendering.

API Methods

setApplicationParameter(params, options)

This API sets the application parameters for the Sheet application. Application parameters can be specified as references when specifying filter values. If the reference for the appropriate parameter is set in the filter, the reference is replaced with the value of the parameter and the sheet display is automatically refreshed.

In the filters for text type or ID type field, and advanced filters, the values of application parameters can be specified as reference and used as filter values. See for more information.

// Pass application parameter names and its values in Key-Value pairs
MsmxSheet.setApplicationParameter({
  Name: 'Salesforce',
  Type: ['Partner', 'Customer'] // multiple parameters can be passed in array
});

// Unset "Type" parameter
MsmxSheet.setApplicationParameter({
  Name: 'Salesforce'
}, {
 forceLoad: true // refresh foreground sheet if no parameter changes
});

Parameters

  • params - (required) Pass application parameter names and its values in Key-Value pairs.

  • options - (optional) Option parameters. With the forceLoad option property you can force the data refresh

updateApplicationParameter(params, options)

Update application parameter values set in the Sheet Application. The difference with setApplicationParameter is that it replaces only the value of specified parameters and others will be remained as previous.

// First, parameters are all unset.
// => {}

MsmxSheet.updateApplicationParameter({
  Name: 'Mashmatrix'
});
// => { Name: 'Mashmatrix }

MsmxSheet.updateApplicationParameter({
  Type: ['Customer']
});
// => { Name: 'Mashmatrix, Type: ['Customer'] }

// If you want to unset/clear specified parameters, use "undefined".
MsmxSheet.updateApplicationParameter({
  Name: undefined
});
// => { Type: ['Customer'] }

Parameters

  • params - (required) Pass application parameter names and its values in Key-Value pairs.

  • options - (optional) Option parameters. With the forceLoad option property you can force the data refresh

subscribeComponentEvent(compId, path, event, listener)

Set a listner function to subscribe events fired from the sheet in the component of msmxSheet:SheetView.

<msmxSheet:SheetView
  id="comp-01"
  bookId="a002800001O6vOpAAJ"
  sheetID="s1"
  width="100%" height="400px"
/>
// Subscribe record load completion event of the sheet
MsmxSheet.subscribeComponentEvent(
  'comp-01',
  'a002800001O6vOpAAJ/s1',
  'loadComplete',
  function(res) {
    console.log(res.records); // List of records loaded
  }
);

// Subscribe record selection change event of the sheet
MsmxSheet.subscribeComponentEvent(
  'comp-01',
  'a002800001O6vOpAAJ/s1',
  'selectRecords',
  function(res) {
    console.log(res.records); // List of records selected in record selection checkbox
  }
);

Parameters

  • compId - (required) Target component ID (specified in id attribute of msmxSheet:SheetView component tag)

  • path - (required) Concatenation of Book ID and Sheet ID with "/"

  • event - (required) Event name to subscribe

  • listener - (required) Listener function which will be notified by the event

unsubscribeComponentEvent(compId, path, event, listener)

Unset listener functions to unsubscribe events fired from the sheet in the component of msmxSheet:SheetView.

Parameters

  • compId - (required) Target component ID (specified in id attribute of msmxSheet:SheetView component tag)

  • path - (required) Concatenation of Book ID and Sheet ID with "/"

  • event - (required) Event name to subscribe

  • listener - (optional) Listener function registered in subscription. If omit this all listeneres for the event will be unsubscribed.

Event Types

selectRecords

Event which will be notified when the selection of records has changed.

Event Parameters

  • records - List of records selected

loadComplete

Event which will be notified when the records are loaded.

Event Parameters

  • records - List of records loaded

focusCell

Event which will be notified when a cell in the sheet is focused (for example by clicking).

Event Parameters

  • cell - Stores information about the focused cell

    • recordId - The ID of the record shown in focused cell

    • colIndex - Column index position of the cell

    • rowIndex - Row index position of the cell (in all pages)

    • value - The raw value of the item displayed in the cell

"Using Reference Value in Filter"