javascript - Breeze Navigation Array Members are DependentObservables in Knockout? -


I am using a clicked binding handler which was posted by RP Neymore long ago. It works great:

  ko.bindingHandlers.hidden = {update: function (element, value assessor) {ko.bindingHandlers.visible.update (element, work () {return! Ko .utils unwanted obsevable (value;);}); }}; Ko.bindingHandlers.ClickToEdit = {init: function (element, valueAccessor) {var notable = valueAccessor (), link = document.createElement ("a"), input = document.createElement ("input"); Element.appendChild (link); Element.appendChild (input); Observable.editing = ko.observable (wrong); Ko.applyBindingsToNode (link, {text: observation, hidden: view, edit, click: view, edit, bid (tap, true)}); Ko.applyBindingsToNode (Input, {value: visible, visible: observable.editing, hasfocus: observable.editing, event: {keyup: function, (data, event) {// if the user enters the hit, the edit does on the wrong , Which creates the field lose focus (event.keyCode === 13) Edit (wrong); Return Return;} // If the user avoids the hit, press the current view value back into the field, then false edit If set (event .keycode === 27) {observable.valueHasMutated (); see edit (false); returning;}}}}); }};  

I have the problem that the Escape key does not work with the elements from the array that the array provided by JS. Apparently these are dependable Observatives and they do not have the value. I am usually confused about one) How can I modify it to work for the Breeze dependent observation?

Thanks

Itemprop = "text">

Breeze.js already Is taking care of 'Undo' for your organizations, so the binding handler is a little unnecessary to you without knowing exactly how you are using it and how the other references can have a bearing, you can always see it Is it a bridge unit in the past and the current implementation does not have fallback -

  keyup: function (data, events) {// Aug If the user enters a hit, so editing is wrong, that the field loses focus (event.keyCode === 13) {observable.editing (false); return false; } // If the user hits, push the current observation value back to the field, then lie and set the edit if (event.keyCode === 27) {if (observable.entityAspect) {observable.entityAspect .cancelChanges (); Observable.editing (wrong); return false; } Else {observable.valueHasMutated (); Observable.editing (wrong); return false; }}}  

Comments