2017-11-27 3 views
1

SelectAllActiveEnabled이 true이면 확인란을 클릭 할 수 있고 css 커서 값은 포인터입니다. SelectAllActiveEnabled이 false로 평가되면 css 커서 값이 여전히 포인터 인 채로 확인란을 클릭 할 수 없습니다. 허용되지 않도록 설정하려면 어떻게해야합니까? 당신이 "순수 녹아웃"솔루션을 찾고 있다면knockout 체크 박스 레이블에서 css- 커서를 포인터에서 허용되지 않음으로 설정

<label> 
    <input type="checkbox" data-bind="checked: selectAllActiveReleases, enable: SelectAllActiveEnabled" /> 
    @Html.GetTranslation(Center.Infrastructure.TranslationSources.Center_Web_Orders_ReleaseFull_ReleaseOverview_LabelSelectAllActiveReleases) 
</label> 
+0

커서를 변경하려면': enabled' CSS 선택기를 사용하십시오. 녹아웃으로 그렇게하는 것을 괴롭히지 마십시오. – Tomalak

+0

'input [type = checkbox] : disabled { 커서 : 허용되지 않음; }' – adiga

답변

0

이 같은 바인딩 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';});