addEventListener

Adds an Event Listener to the Gebra Suite or one of its controls

Parameters

  1. Events

  2. Control Id (optional)

    • If the event is control specific (e.g. click on a buttton), this has to be the control id of that button

  3. Function

    • The code that should be executed in case of this event

    • The first parameter is the app

Example Usages

app.addEventListener("onRecordSaved", function (app, eventArgs) {
  alert("Record saved in " + app.appName);
});

Where "onRecordSaved" denotes the name of the name of the event that is going to be listened for. The second parameter in this case is an arbitrary function function(app, eventArgs), which executes the respective event. Recall that this example does not contain a control id.

app.addEventListener(
  "onClick",
  "myButton",
  function (/*event parameters are optional*/) {
    alert("Button clicked");
  }
);

Return Values

Function does not explicitly produce return value.

Last updated