I have a custom binding for a jquery autogrow plugin that can be seen here Autosize knockout custom binding autosize on load
The code for reference:
ko.bindingHandlers.autogrow = {
init: function (element, valueAccessor, allBindingsAccessor) {
ko.applyBindingsToNode(element, { value: valueAccessor() });
ko.utils.domNodeDisposal.addDisposeCallback(element, function () {
//$(element).data('autosize').remove();
});
$(element).autosize({ append: "\n" });
$(element).focus(function () {
$(element).trigger('autosize');
});
}
};
I am using it as follows:
<textarea id="autogrow" class="text-nm span2" data-bind="autogrow: AreaProcessName, attr: { id: 'AreaProcessName' + Id }, event: { change: ViewModel.vmAreaProcess.SetAreaRevision($data) }"></textarea>
The attr binding is still working but the event binding on change has stopped working.
Any ideas?