jQuery click binding in a KnockoutJS foreach doesn't work

jquery, knockout.js

Solution

Without seeing any of the code, I can only assume that you are doing something similar to

$('element').on('click', function(e){});

To bind a click event to dynamically generated objects you need to have your click events like this

$('body').on('click', 'element', function(e){});

Problem

I have a jQuery click binding within a knockoutJS foreach, and it's not working. I believe that knockout is stopping the propagation. Is there a way to make it work? I'm trying to avoid binding to click event with knockout.

Original source