Skip to content

Removing Relation Event Listeners

Description

This operation deletes relation event listeners registered for a specific data table.

Methods

Relation Added Listeners

//Removing all listeners
removeAddRelationListeners(): Backendless.EventHandler;

//Removing specific listeners by using a callback object. Deletes all listeners with a callback object
removeAddRelationListener(callback: (data: RTChangeRelationStatus) => void): Backendless.EventHandler;

//Removing specific listeners by column name. Deletes all listeners using the specified column name
removeAddRelationListeners(relationColumnName: string): Backendless.EventHandler;

Relation Set Listeners

//Removing all listeners
removeSetRelationListeners(): Backendless.EventHandler;

//Removing specific listeners by using a callback object. Deletes all listeners with a callback object
removeSetRelationListener(callback: (data: RTChangeRelationStatus) => void): Backendless.EventHandler;

//Removing specific listeners by column name. Deletes all listeners using the specified column name
removeSetRelationListeners(relationColumnName: string): Backendless.EventHandler;

Relation Deleted Listeners

//Removing all listeners
removeDeleteRelationListeners(): Backendless.EventHandler;

//Removing specific listeners by using a callback object. Deletes all listeners with a callback object
removeDeleteRelationListener(callback: (data: RTChangeRelationStatus) => void): Backendless.EventHandler;

//Removing specific listeners by column name. Deletes all listeners using the specified column name
removeDeleteRelationListeners(relationColumnName: string): Backendless.EventHandler;

where:

Argument                Description
relationColumnName Sets the name of the column to delete specific listeners by column name.
callback The contents of the callback object can be used to delete specific event listeners.

Return Value

None.

Examples

Relation Added Listeners

The example below showcases three scenarios where relation listeners registered for the "Person" data table are deleted:

const personEventHandler = Backendless.Data.of('Person').rt()

//Removing all listeners
personEventHandler.removeAddRelationListeners()

//Removing specific listeners by using a callback object. Deletes all listeners with a callback object
personEventHandler.removeAddRelationListeners(callback)

//Removing specific listeners by column name. Deletes all listeners using the specified column name
personEventHandler.removeAddRelationListeners(columnName)

Relation Set Listeners

The example below showcases three scenarios where relation listeners registered for the "Person" data table are deleted:

const personEventHandler = Backendless.Data.of('Person').rt()

//Removing all listeners
personEventHandler.removeSetRelationListeners()

//Removing specific listeners by using a callback object. Deletes all listeners with a callback object
personEventHandler.removeSetRelationListeners(callback)

//Removing specific listeners by column name. Deletes all listeners using the specified column name
personEventHandler.removeSetRelationListeners(columnName)

Relation Deleted Listeners

The example below showcases three scenarios where relation listeners registered for the "Person" data table are deleted:

const personEventHandler = Backendless.Data.of('Person').rt()

//Removing all listeners
personEventHandler.eventHandler.removeDeleteRelationListeners()

//Removing specific listeners by using a callback object. Deletes all listeners with a callback object
personEventHandler.eventHandler.removeDeleteRelationListeners(callback)

//Removing specific listeners by column name. Deletes all listeners using the specified column name
personEventHandler.eventHandler.removeDeleteRelationListeners(columnName)

Codeless Reference

rt_database_remove_listener_1

where:

Argument                Description
id Unique identifier of the event listener that must be deleted.

This operation does not return a value.

Delete "Add Relation Listener"

The example below registers a new "Add Relation" event listener with the id``"1EFD-3GEF2-FF4C-AC21" , waits for 15000 milliseconds and deletes the event listener afterwards.

rt_remove_add_relation_listener_1

Delete "Set Relation Listener"

The example below registers a new "Set Relation" event listener with the id``"1EFD-3GEF2-FF4C-AC21" , waits for 15000 milliseconds and deletes the event listener afterwards.

rt_remove_set_relation_listener_2

Remove "Delete Relation Listener"

The example below registers a new "Delete Relation" event listener with the id``"1EFD-3GEF2-FF4C-AC21" , waits for 15000 milliseconds and deletes the event listener afterwards.

rt_remove_delete_relation_listener_3