diff --git a/docs/marionette.view.md b/docs/marionette.view.md index 99ec9415d2..d2a2d6f149 100644 --- a/docs/marionette.view.md +++ b/docs/marionette.view.md @@ -158,6 +158,19 @@ view.$(".do-something").trigger("click"); The result of this is an alert box that says, "I DID IT!" +By default all triggers are stopped with `preventDefault` and `stopPropagation` methods. But you can manually configure the triggers using hash instead of event name. Example below triggers an event and prevents default browser behaviour using `preventDefault` method. +```js +Backbone.Marionette.CompositeView.extend({ + triggers: { + "click .do-something": { + event: "something:do:it", + preventDefault: true, + stopPropagation: false // this param is optional and will default to false + } + } +}); +``` + You can also specify the `triggers` as a function that returns a hash of trigger configurations