I was trying to enable/disable a top-right combo button. Here's a list of things that confused me:
1. I cannot disable a combo button via JavaScript. I've tried the following:
btn.enabled = false btn.disabled = true btn.style.enabled = false btn.style.disabled = true btn.enable = false btn.disable = true btn.style.enable = false btn.style.disable = true
and none of them worked. How can I do this?
2. Since none of the methods worked on disabling the button, I set the button's visibility to "hidden" to hide the button. However, I still caught the 'activate' event of the corresponding hardware button when it's pressed. Is there any way that I can disable the hardware button?
Thanks!
Answered! Go to the Best Answer.
Best AnswerYou can use
document.disable();
See documentation at https://dev.fitbit.com/build/reference/device-api/document/#interface-combobutton-
You can use
document.disable();
See documentation at https://dev.fitbit.com/build/reference/device-api/document/#interface-combobutton-
Thanks! That's what I'm looking for! Forgive me for not reading the document clearly :p. However I'd like to point out that the boolean argument for the method is used to choose whether the item should be animated, not whether it should be disabled. Here's the code snippet for enable/disable the button:
btn.disable() // Disable the button btn.enable() // Enable the button