I'm having an issue with the enabled binding of a button. It's bound to function on a view model (kendo.observable) that returns a Boolean value based on the values of properties on the same view model. The binding runs once, when bound, but never again after the properties of the view model have changed. Is there any way that I can get this binding to 'refresh' on property change? Code below:
var
viewModel = kendo.observable({
userName:
null
,
password:
null
,
isEnabled:
function
() {
var
self =
this
;
return
self.userName != undefined && self.password != undefined;
}
});
And the HTML:
<
button
class
=
"k-button k-primary"
data-bind
=
"click: onClicked, enabled: isEnabled"
>Click</
button
>