Knockout data-bind disable. With two conditions
Asked Answered
A

1

5

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.

Appear answered 31/3, 2014 at 10:0 Comment(0)
L
8

If isDeliveryHistory and isTimeAndMaterialLocked are observables, you should use them like this:

data-bind="click: createSubActivity, disable: isDeliveryHistory() || isTimeAndMaterialLocked()"
Lyell answered 31/3, 2014 at 10:4 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.