I've got a ko.observable in my viewmodel, which is attached to an input. When user changes value of that input (per-character) I run AJAX call, which downloads suggestions from backend.
When user chooses one of suggestions, I'd like to fill the input with chosen value, but without sending the AJAX call. But setting observable's value will still trigger event and call function attached to textInput binding.
How can I set observable's value without triggering textInput?
Sample code:
var name = ko.observable(); name.subscribe(nameChanged); var nameChanged = function() { someService.post(name(), success, failure); } var someAction = function() { name("Test"); // I don't want to trigger AJAX call here } <input type="text" data-bind="textInput: name" />