EaxToolBarView.ObjectStateChanged

Syntax

ObjectStateChanged: function (sender, args);

Parameters

sender. Event source.

args. Event information. Available arguments - object of the PP.Mb.Ui.PropertyChangedEventArgs type containing the following properties: PropertyName - property name as an element of the PP.Exp.Ui.ControlType enumeration, Metadata - metadata, TypeUpdateData - updated data type that is set by means of the PP.Exp.Ui.ViewTypeUpdate enumeration.

Description

The ObjectStateChanged event occurs after changing the object state.

Comments

In this context the event occurs after toggling state (selected or deselected) of the button in the group of buttons used to choose data view mode.

Example

Executing the example requires that the HTML page contains the ExpressBox component named expressBox (see Example of Creating the ExpressBox Component). Handle the ObjectStateChanged event:

// Get button group view for selecting data display mode
var toolBar = expressBox.getDataView().getToolBarView();
toolBar.ObjectStateChanged.add(
function(sender, args) { 
     if (args.getMetadata().chart.visible) {
         alert("Chart is active.");
     } 
     else {
         alert("Chart is not active.");
     }
});
// make the Chart button active
toolBar.setActiveObject(PP.Exp.Ui.EaxObjectType.Chart);

After executing the example the Chart button is active, and the ObjectStateChanged event occurs. Due to this event the browser console displays a message that the chart is active.

See also:

EaxToolBarView