Couple things I noticed, you are binding the control and event handler to the dynamically generated offers as opposed top the parent dom element, #wrapper. Why not instantiate the control on wrapper and click events will be delegated to any number added later. So for sake of testing, if you changed to:
- can.Control.extend('mynamespace.fooController',{
- init: function( element , options ) {
- },
- '.offer click': function( $ct, evt ){
- alert( $ct.index() );
- }
- });
- new mynamespace.fooController('#wrapper');
Then you don't even need to rebind. Does that make sense?