knockout.js - How to set valueUpdate binding globally in knockoutjs? -


i started using knockoutjs , couldn't find way bind valueupdate on afterkeydown input fields @ once. there way or have add valueupdate: afterkeydown every input fields?

thanks in advance

you can use binding provider plugin

https://github.com/rniemeyer/knockout-classbindingprovider

or can create custom binding

http://jsfiddle.net/4jrkv/

ko.bindinghandlers.value2 = {     init: function(element, valueaccessor, allbindingsaccessor, viewmodel, bindingcontext) {         ko.applybindingstonode(element, { value: valueaccessor(), valueupdate: "afterkeydown" });     } }; 

Comments

Popular posts from this blog

linux - xterm copying to CLIPBOARD using copy-selection causes automatic updating of CLIPBOARD upon mouse selection -

c++ - qgraphicsview horizontal scrolling always has a vertical delta -