EaxMdService.setVisibility

Syntax

setVisibility(report: PP.Exp.EaxDocument, metadata: Object, callback: PP.Delegate);

Parameters

report. Express report document.

metadata. Object that contains visibility settings for express report data views: bubble chart, chart, table and map.

callback. Callback function.

Description

The setVisibility method controls visibility of express report views.

Example

Executing the example requires that the HTML page contains the ExpressBox component named expressBox (see Example of Creating the ExpressBox Component). Hide the Chart view from express report:

// Get a service used to work with express report
var eaxMdService = expressBox.getService();
// Get express report document
var eaxAnalyzer = expressBox.getSource();
// Determine visibility settings of express report views
var metadata = {
    bubbleChart: {
        enabled: True,
        visible: False
    },
    chart: { // Hide the Chart view
        enabled: False,
        visible: False
    },
    grid: {
        enabled: True,
        visible: True
    },
    map: {
        enabled: True,
        visible: True
    }
};
// Determine arguments for callback function
var args = new PP.Mb.Ui.PropertyChangedEventArgs({   
    PropertyName: PP.Exp.Ui.ControlType.ObjVisibility,
    Metadata: metadata,
    TypeUpdateData: PP.Exp.Ui.ViewTypeUpdate.All
});
// Determine callback function
var onPanelChanged = function (n, t) {        
    var chartView = expressBox.getDataView().getChartView();    
    t ? (chartView.DataChanged.fire(chartView, t.Args), t.Args.fireCallback(n, t)) : chartView.DataChanged.fire(chartView, t);
    // Refresh express report data area
    var dataView = expressBox.getDataView();
    dataView.refreshAll();
};
// Hide the Chart view of express report
eaxMbService.setVisibility(eaxAnalyzer, metadata, PP.Delegate(this.onPanelChanged, eaxMdService, args));

After executing the example the Chart view of express report is hidden.

See also:

EaxMdService