Can Collection instance be binded to a custom event? I tried it with jQuery: $(collectionInstance).on(eventsmap).
When I then try to check registered events:
console.log($.data(collectionInstance, 'events'));
I get all custom events I bound to an instance.
But $(collection).trigger('customevent'); doesn’t fire this customevent and event handler is not called.
When I try the same with Backbone.View I can trigger custom events whithout any problems. Why is like that? Am I missing something?
Backbone collections have
Backbone.Eventsmixed in so collections haveon,off, andtriggermethods. You want to use those methods rather than trying to wrap the collection in jQuery:and then elsewhere: