I'm creating a Knockout binding that will work as a wrapper around a jQuery widget. This widget applies event handlers to child elements. Unfortunately, the widget's event handling is applied directly to the child elements, not delegated. The issue is that I have a foreach
binding on the same element, but I need the custom binding to be applied after the foreach
binding is applied.
Obviously, the right thing is to fix the jQuery plugin, but this isn't an option at this time. I'm wondering if there are any good workaround options for me. Is there way, for example, to do any of the following?
- Detect whether a particular binding has been applied
- Affect the ordering of binding application
- Safely force another binding to take place
Update:
One aspect I should mention is that this custom and foreach
binding reside in a template. Therefore, solutions that directly modify the DOM won't work for me since it will actually modify the template.