当SelectAllActiveEnabled
为真时,该复选框是可单击的,并且css游标值是指针。当SelectAllActiveEnabled
求值为false时,复选框不可单击,但css游标值仍为指针。如何将其设置为不允许?
<label>
<input type="checkbox" data-bind="checked: selectAllActiveReleases, enable: SelectAllActiveEnabled" />
@Html.GetTranslation(Center.Infrastructure.TranslationSources.Center_Web_Orders_ReleaseFull_ReleaseOverview_LabelSelectAllActiveReleases)
</label>
答案 0 :(得分:0)
如果您正在寻找&#34;纯粹淘汰赛&#34;您应该使用style
绑定解决方案:
<input type="checkbox" data-bind="checked: selectAllActiveReleases, enable: SelectAllActiveEnabled, style:{'cursor': cursorForCheckbox()}" />
您必须向视图模型中引入cursorForCheckbox
。像这样:
self.cursorForCheckbox = ko.pureComputed(function() {return self.SelectAllActiveEnabled() ? 'pointer' : 'not-allowed';});