Hey, I’m trying to convert my static pages into dynamic but I stumbled on a issue I just cant solve.
Basically, I have buttons (with hyperlinks associated) which are usually coloured blue-royal and they’re red-coloured when links arent available for that subject.
Up-to-recently, I’ve been manually changing the colour of the button when there wasn’t a hyperlink available (ie reference cell in database is empty).
Does anybody know how to dynamically change button colour in similar contexts?
To change the button text color, you can do something like this:
$w("#button1").style.color = "red"; // or use rgb, for example: "rgb(255,0,0)" instead of the color name.
You can also make it conditional:
!$w('#dynamicDataset').getCurrentItem.url ? $w("#button1").style.color = "red" : $w("#button1").style.color = "blue"; //use the dataset property name, the button property name and the link field key (here I used the field key "url" as an example)
Hey, I’m now converting pages to be rendered “dynamically & with a repeater” but I tried adapting the existing code to apply in this new scenario and it doesn’t seem to work: