Fitbit Developers oversee the SDK and API forums. We're here to answer questions about Fitbit developer tools, assist with projects, and make sure your voice is heard by the development team.
Fitbit Developers oversee the SDK and API forums. We're here to answer questions about Fitbit developer tools, assist with projects, and make sure your voice is heard by the development team.
If you follow the checkbox list example, you can deselect the other items like this:
import document from "document";
let tileList = document.getElementById("tile-list");
let tileItems = tileList.getElementsByClassName("tile-item");
let tileState = {}
tileItems.forEach((element, index) => {
tileState[index] = element.firstChild.value; // initial state
element.firstChild.onclick = (evt) => {
tileState[index] = !tileState[index];
uncheckAllExceptSelected(index);
console.log(`item ${index} :: ${tileState[index] ? "checked" : "unchecked"}`)
};
});
function uncheckAllExceptSelected(selected) {
tileItems.forEach((element, index) => {
if (index !== selected) {
tileState[index] = false;
element.firstChild.value = 0;
}
});
}
@JonFitbit Is it possible to implement the radio button functionality in dynamic(virtual tile list) also, as per your comment its working fine static tile-list. Thanks in advance.
Best AnswerYour solution working fine with static tile-list.
Please provide the solution for virtual-tile-list
Best Answer