---
metadata:
  - name: generator
    content: Diplodoc Platform v5.39.1
alternate:
  - https://yandex.ru/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/Event.md
  - https://yandex.ru/dev/jsapi-v2-1/doc/ru/v2-1/ref/reference/Event.md
---
> **Documentation Index:** Fetch the complete configuration index at https://yandex.ru/dev/jsapi-v2-1/doc/en/llms.txt

# Event

Extends [IEvent](https://yandex.ru/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/IEvent.md).

Event. Provides methods for accessing the originalObject object's fields and methods, with the possibility for redefining them.

[Constructor](#constructor-summary) | [Methods](#methods-summary)

## Constructor {#constructor-summary}

```javascript
Event(originalEvent[, sourceEvent])
```

Creates an event.

**Parameters:**

#|
|| **Parameter** | **Default value** | **Description**  ||
|| [`originalEvent`](#param-originalEvent)[*](*star) | — | Type: Object

Source data. ||
|| [`sourceEvent`](#param-sourceEvent) | — | Type: [IEvent](https://yandex.ru/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/IEvent.md)

Source event. ||
|#

\* Mandatory parameter/option.

## Methods {#methods-summary}

#|
|| **Name** | **Returns** | **Description** ||
|| [allowMapEvent](https://yandex.ru/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/IEvent.md#allowMapEvent)() | | Allows the propagation of the event to the map.

Inherited from [IEvent](https://yandex.ru/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/IEvent.md#allowMapEvent). ||
|| [callMethod](https://yandex.ru/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/Event.md#callMethod)([name](https://yandex.ru/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/Event.md#callMethod-param-name)) | Object
| Calls the specified method. The operation is equivalent to searching fields via "get" and making a call that passes originalEvent as context. All arguments after the first one are passed as parameters to the method being called. ||
|| [get](https://yandex.ru/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/Event.md#get)([name](https://yandex.ru/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/Event.md#get-param-name)) | Object
| Returns the field value from originalEvent. originalEvent always has the following fields: 
- type - String event type.
- target - Reference to the object that generated the event. ||
|| [getSourceEvent](https://yandex.ru/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/IEvent.md#getSourceEvent)() | [IEvent](https://yandex.ru/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/IEvent.md)\|null
| Returns source event.

Inherited from [IEvent](https://yandex.ru/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/IEvent.md#getSourceEvent). ||
|| [isDefaultPrevented](https://yandex.ru/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/Event.md#isDefaultPrevented)() | Boolean
| Checks whether the default reaction to the event is canceled in the Yandex Maps API event system. ||
|| [isImmediatePropagationStopped](https://yandex.ru/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/Event.md#isImmediatePropagationStopped)() | Boolean
| Checks whether event propagation is stopped in the Yandex Maps API event system. ||
|| [isMapEventAllowed](https://yandex.ru/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/IEvent.md#isMapEventAllowed)() | Boolean
| Returns true if the map event is enabled.

Inherited from [IEvent](https://yandex.ru/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/IEvent.md#isMapEventAllowed). ||
|| [isPropagationStopped](https://yandex.ru/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/Event.md#isPropagationStopped)() | Boolean
| Checks whether event propagation up the hierarchy of objects and collections is stopped in the Yandex Maps API event system. ||
|| [preventDefault](https://yandex.ru/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/Event.md#preventDefault)() | | Cancels the default reaction to an event within the Yandex Maps API event system. Calling this method does not affect propagation of the DOM source event (if there is one) through the DOM tree. ||
|| [stopImmediatePropagation](https://yandex.ru/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/Event.md#stopImmediatePropagation)() | | Stops event propagation in the Yandex Maps API event system. Calling this method does not affect propagation of the DOM source event (if there is one) through the DOM tree. ||
|| [stopPropagation](https://yandex.ru/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/Event.md#stopPropagation)() | | Stops event propagation up the hierarchy of objects and collections in the Yandex Maps API event system. Calling this method does not affect propagation of the DOM source event (if there is one) through the DOM tree. ||
|#

## Methods details {#method_detail}

### callMethod {#callMethod}

```javascript
{Object} callMethod(name)
```

Calls the specified method. The operation is equivalent to searching fields via "get" and making a call that passes originalEvent as context. All arguments after the first one are passed as parameters to the method being called.

**Returns** value.

**Parameters:**

#|
|| **Parameter** | **Default value** | **Description**  ||
|| [`name`](#callMethod-param-name)[*](*star) | — | Type: String

Method name. ||
|#

\* Mandatory parameter/option.

### get {#get}

```javascript
{Object} get(name)
```

**Returns** the field value from originalEvent. originalEvent always has the following fields: 
- type - String event type.
- target - Reference to the object that generated the event.

**Parameters:**

#|
|| **Parameter** | **Default value** | **Description**  ||
|| [`name`](#get-param-name)[*](*star) | — | Type: String

Property name. ||
|#

\* Mandatory parameter/option.

**Example:**

```javascript
// Synchronizing two objects with each other.
object1.events.add(["add", "remove"], function (event) {
    object2[event.get("type")](event.get("child"));
});
```

### isDefaultPrevented {#isDefaultPrevented}

```javascript
{Boolean} isDefaultPrevented()
```

Checks whether the default reaction to the event is canceled in the Yandex Maps API event system.

**Returns** true if the default reaction to the event is canceled, otherwise false.

### isImmediatePropagationStopped {#isImmediatePropagationStopped}

```javascript
{Boolean} isImmediatePropagationStopped()
```

Checks whether event propagation is stopped in the Yandex Maps API event system.

**Returns** true if propagation was stopped, or false if not.

### isPropagationStopped {#isPropagationStopped}

```javascript
{Boolean} isPropagationStopped()
```

Checks whether event propagation up the hierarchy of objects and collections is stopped in the Yandex Maps API event system.

**Returns** true if propagation up the hierarchy is canceled; otherwise, false.

### preventDefault {#preventDefault}

```javascript
{} preventDefault()
```

Cancels the default reaction to an event within the Yandex Maps API event system. Calling this method does not affect propagation of the DOM source event (if there is one) through the DOM tree.

### stopImmediatePropagation {#stopImmediatePropagation}

```javascript
{} stopImmediatePropagation()
```

Stops event propagation in the Yandex Maps API event system. Calling this method does not affect propagation of the DOM source event (if there is one) through the DOM tree.

### stopPropagation {#stopPropagation}

```javascript
{} stopPropagation()
```

Stops event propagation up the hierarchy of objects and collections in the Yandex Maps API event system. Calling this method does not affect propagation of the DOM source event (if there is one) through the DOM tree.

[*star]: Mandatory parameter/option.