How to detache an event handler from an event in a view

Detaches an event handler from an event in a view.

You can only remove event handlers that were added to the same extension with addToViewEventsDefinition. You cannot use this method to remove built-in event handlers.

var layout = container.getComponent('Layout');

layout.addToEventsDefintion(
  'Header.View',
  'click [data-action="sidebar-toggle-icon-clickable"]',
  function(event) {
    console.log(event);
  }
);

layout.removeToViewEventsDefinition('Header.View', 'click [data-action="sidebar-toggle-icon-clickable"]');

Leave a comment

Your email address will not be published. Required fields are marked *