nstudio / nativescript-checkbox

NativeScript plugin for checkbox UI component
Other
119 stars 56 forks source link

How to disable the control? #20

Closed manishmlv50 closed 7 years ago

manishmlv50 commented 7 years ago

I have used the checkbox element as

<CheckBox #CB14 text="Agree" checked="false">

How to disable the control if condition is false

bradmartin commented 7 years ago

You should be able to use the isEnabled property from the NativeScript View class here: https://docs.nativescript.org/api-reference/classes/_ui_core_view_.view.html#isenabled

bradmartin commented 7 years ago

Added to demo: https://github.com/bradmartin/nativescript-checkbox/commit/c5ab46fb80462d1549b83689f337da2719660f4c#diff-3167d0572d77431a35f0f5792b8aaab0R30

Using the isEnabled property of the base View class for NativeScript components is all you need 😄