# addEventListener

### 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 brixxApi

### Example Usages

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

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