getState

returns the reactive state object of Report Manager

object getState();

Returns

objectstate object

Example

// returns the current state of Report Manager
const state = $$("myReports").getState();

Related samples

Details

The returned state object contains the following properties and methods:

{
  mode: "edit",
  module: null,
  moduleId: 20,
  saved: true,
  readonly:false,
  toolbar: false 
}

Properties

  • mode (string) - view mode with possible values:
    • "list" - the list of modules opened;
    • "view" - a module is opened and "list" closed;
    • "edit" - editing form for a module is opened;
  • module (object) - JSON that contains module settings ( data source, columns, ...). Read-only;
  • moduleId (string) - the ID of the report being currently viewed;
  • saved (boolean) - if true the selected module is saved. false if the module settings are edited but not saved. Read-only;
  • readonly (boolean) - if true hides editing controls. false by default.
  • toolbar (boolean) - if false hides the toolbar. true by default.

Methods

  • $observe (function) - a handler to listen to changes in the current state of Report Manager. It takes 2 parameters:
    • prop (string) - a reactive property to listen changes of
    • handler (function) - a function to execute when changes are made. It takes the only argument:
      • value (any) - the current value of the reactive property. The type of the value (string, array, etc) depends on a reactive property being observed.
  • batch (function)- allows to set several properties at once. Takes the only parameter:
    • props (object) - an object containing the pairs of the property name and the value to set.
Back to top