getState
returns the reactive state object of Report Manager
object getState();
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 whose changes you want to listen to;
- handler (function) - a function to execute when changes are made. It takes a single argument:
- value (any) - the current value of the reactive property. The type of the value (string, array, etc.) depends on the reactive property being observed.
- $batch (function) - allows setting several properties at once. It takes a single parameter:
- props (object) - an object containing pairs of property names and values to set.
Back to top
Join Our Forum
We've retired comments here. Visit our forum for faster technical support,
connect with other developers, and share your feedback there.