01-21-2018 03:19
01-21-2018 03:19
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.
01-22-2018 08:50 - edited 01-24-2018 07:40
01-22-2018 08:50 - edited 01-24-2018 07:40
You can use
document.disable();
See documentation at https://dev.fitbit.com/build/reference/device-api/document/#interface-combobutton-
01-22-2018 08:50 - edited 01-24-2018 07:40
01-22-2018 08:50 - edited 01-24-2018 07:40
You can use
document.disable();
See documentation at https://dev.fitbit.com/build/reference/device-api/document/#interface-combobutton-
01-23-2018 08:21
01-23-2018 08:21
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
01-24-2018 07:40
01-24-2018 07:40
Good point!