Is there any way to specify an enable condition for the click binding? For example if I have the following:
<div data-bind="click: toggleDialog">Click Me</div>
I'd like to be able to disable clicking if a specified condition occurs so something to the effect of:
<div data-bind="click: toggleDialog, enableClick: myName() === 'John'">Click Me</div>
I'm thinking maybe a custom binding would work for this, but not quite exactly sure how to go about doing it.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…