I just started using knockoutjs, and I could not find a way to bind valueUpdate to afterkeydown for all input fields at once. Is there a way to do this or do I really need to add valueUpdate: afterKeyDown for each input field?
Thank you in advance
You can use this binding provider plugin
https://github.com/rniemeyer/knockout-classBindingProvider
Or you can create a custom snap
http://jsfiddle.net/4jRKV/
ko.bindingHandlers.value2 = { init: function(element, valueAccessor, allBindingsAccessor, viewModel, bindingContext) { ko.applyBindingsToNode(element, { value: valueAccessor(), valueUpdate: "afterkeydown" }); } };
Source: https://habr.com/ru/post/1479954/More articles:PHP CLI - user request to enter or perform actions after a certain period of time - command-line-interfaceUsing Angular JS ng-csp Directives to Create Privileged Applications for Firefox - angularjsPHP CLI - enter the user when doing something in the background - command-line-interfaceInvalid class arguments - c ++Using "Ajax updated" dataset with cross filter - jsonWhy should the lock be copied and not saved? When do you not need to copy a block? - iosUncaught RangeError: maximum call stack size exceeded with innerHTML - javascriptIn XSLT 2.0, why not fn: decode-for-uri? - xsltAccess to the newly added key => value in the associative array during the loop - arraysHolo theme makes my button bigger - androidAll Articles