Is it possible to use || operator in disable like this:
data-bind="click: createSubActivity, disable: isDeliveryHistory || isTimeAndMaterialLocked"
I have tried, but it seems like it doesn't work.
Knockout's declarative binding system provides a concise and powerful way to link data to the UI. It's generally easy and obvious to bind to simple data properties or to use a single binding.
Knockout now supports multiple model binding. The ko. applyBindings() method takes an optional parameter - the element and its descendants to which the binding will be activated. This restricts the activation to the element with ID someElementId and its descendants.
The "data-bind" attribute contains a collection of comma-separated options for how Knockout should bind a view model property to an HTML element. The two examples above use only a single option: the "value" binding handler.
If isDeliveryHistory
and isTimeAndMaterialLocked
are observables, you should use them like this:
data-bind="click: createSubActivity, disable: isDeliveryHistory() || isTimeAndMaterialLocked()"
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With