javascript - NotifySubscribers is not refreshing UI (Writable Computed) -
I have a writable writing within a custom binding to format a mapping, however, when users remove the formatted mask , The reading function is not triggered, because all the non-points being viewed are being removed, well, it should work, so I added the notification to everyone to read, even if the honorable price changes and its work, But the UI element is not refreshing the new value (see returns)
Follow the code:
ko.bindingHandlers.conta = {init: function (element, value, user) , All BindingsEver, ViewModel, Binding Contx) {Values of Values = value Axtor (), formatted = COPPATED ({read: function} {var val = ko.unwrap (valueAccessor ()); if (! Val) return Val;) if (val.toString (). Length & lt; 6) {val = zeroPad (val, 6); Look (val);} return val.toString () Piece (0, val.toString (). Length - 1) + "-" + val.toString () Piece (val.toString (). Length - 1);}, type: function (value) {if (value) {value = zeroPad (value, 6); } Overview (value location (/ \ D / g, '')); Observable.notifySubscribers (); }}); If ($ (element) .is ('input')) {ko.applyBindingsToNode (element, {numbers: true, maximum length: 10, value: formatted}); } Else {ko.applyBindingsToNode (element, {numbers only: true, text: formatted}); } Return {controlsDescendantBindings: true}; }};
= "Text"> formatted
notify to computed obs : Always
:
ko.bindingHandlers.conta = {init: function (element, value accelerator, all binding equals, view modal, binding contact) {value of honorable value = anassar () , Formatted = COPPEATED ({...}). Expansion ({notify: 'always'}); ...
This will always force you to notify it even when there is no change.
Comments
Post a Comment