@richirv
- You have a DB with a BOOLEAN-DATAFIELD → lets call it “myDATAFIELD”
In this DATAFIELD you have stored some VALUES —> TRUE / FALSE
- You have a BOX inside REPEATER with following ID → “#box1”
$w.onReady(function () {
$w("#repeater1").onItemReady(($item, itemData, index) => {
//Take a look onto ---> CONSOLE! What do you get, when you click on button?
$item('#box1').onClick(()=>{
console.log(itemData);
console.log("DATAFIELD-STATE: ", itemData.myDATAFIELD[index]);
// Code your if-else-query here..... expand your code-functionality.....
if(?????) {$item('#box1').style.backgroundColor = "red"}
else {$item('#box1').style.backgroundColor = "green"}
});
});
});