Based on the way that dependencies are tracked for the individual options in the kendo bindings, you would need to represent your enabled
condition with a computed. Otherwise, the test() == 2
is evaluated immediately and never again.
With your sample, you could bind against a computed like dateEnabled
:
var viewModel = {
date: ko.observable(),
test: ko.observable(),
};
viewModel.dateEnabled = ko.computed(function() {
return viewModel.test() === "2";
});