Hi,
I have a repeater that shows info from a dataset,
and I connected everything OK.
I build a URL using the info from the dataset, but I can’t get it to open in a new tab.
I tried to define the element’s link in the “OnReady” section,
and tried it on “OnClick” button.
I also know about “target = _blank” but no success.
Here is the “onReady” code:
$w.onReady(() => {
$w("#dataset1").onReady( () => {
$w("#repeaterRent").onItemReady(($item, itemData, index) => {
// open google maps in a new tab
let mapsURL = "https://someWebsite"
+ $item("#buttonAddress").label.toString().rep(" ", "+")
+ "," + $item('#textCity').text.replace(" ", "+");
//console.log(mapsURL);
$item("#buttonAddress").link = mapsURL;
$item("#buttonAddress").target = "_blank";
})
});
});
and here is the button code (OnClick):
export function buttonAddress_click(event) {
let $item = $w.at(event.context);
let mapsURL = "someWebsite"
+ $item("#buttonAddress").label.toString().replace(" ", "+")
+ "," + $item('#textCity').text.replace(" ", "+");
//console.log(mapsURL);
$item("#buttonAddress").link = mapsURL;
}