Is it possible? Something like this:
...
events {
'keydown body' : 'doSmth'
}
...
Backbone. js trigger Event is used to invoke or callback the function for the given event or a space-delimited list of events. The subsequent arguments will be passed along to the event callbacks in order to trigger it.
Backbone. Backbone has been around for a long time, but it's still under steady and regular development. It's a good choice if you want a flexible JavaScript framework with a simple model for representing data and getting it into views.
Backend Synchronization BackboneJS is use with the front-end and back-end systems, allows the synchronization with the backend to provide support to RESTful APIs.
This is not possible because Backbone uses the events hash to subscribe to events on the view's element (view.el property) and the element's descendants. It does not subscribe to events from elements outside the view's element.
So if your view's element is table, then the doSomething() function will be called when the keydown event is fired on the table, but it will not be called if the keydown event is fired on another element on the page.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With