As a complex widget, Report Manager consists of many stand-alone Webix views with its own API.
You can redefine inner views and also you can work with the specific Report Manager settings.
You can use the following settings to provide the basic config of the widget:
webix.ui({
view:"reports",
url: "https://docs.webix.com/reports-backend/",
mode: "edit",
toolbar: false
});
Related sample: Report Manager: Single Edit Mode
The moduleId, mode, readonly and toolbar properties are also accessible as reactive via the state. They store global app state and let developers track its changes. The state object also contains a couple of read-only properties:
You can get the current state of the widget with the help of the getState() method:
webix.ui({
view:"reports",
id:"myReports",
url: "https://docs.webix.com/reports-backend/"
});
const state = $$("myReports").getState();
/*
{
mode: "edit",
module: {...report config},
moduleId: 20,
readonly:false,
saved: true,
toolbar: false
}
*/
You can use $observe handler to listen to changes and provide custom handlers for them:
webix.ui({
view: "reports",
url: "https://docs.webix.com/reports-backend/",
on: {
onInit: app => {
const state = app.getState();
state.$observe("moduleId", id => {
if(id) webix.message(`ID of this report is ${id}`);
});
}
}
});
Related sample: Report Manager: Listening to State Changes
In the sample above, the current state is accessed via the instance of the inner JetApp which is available in the onInit event handler.
Back to top