Reputation: 2144
is it possible to us ko.computed by using values which are not observable in viewmodel.
self.EnableSave = ko.computed(function () {
if ($('#PoolName').val().toString().trim().length > 0 && $('#Description').val().toString().trim().length > 0 && self.MatrixList().length > 0) {
return true;
}
else {
return false;
}
});
Upvotes: 0
Views: 59
Reputation: 786
I don't see any reason you couldn't use non-observables in a computed. However, only changes to observables would trigger the computed to fire. In this case, the computed would only reevaluate when MatrixList changes.
Upvotes: 1