Hello,
Am trying to link a button in my repeater to a dynamic page using your code, but am getting error and it’s not working.
Following is the code:
$w.onReady(function () {
$w(‘#resultsRepeater’).onItemReady(($w, itemData, index) => {
$w(“#titleElement”).text = itemData.title;
$w(“#courtElement”).text = itemData.court;
$w(“#dateElement”).text = itemData.date;
$w(“#citationElement”).text = itemData.citation;
$w(“#heldElement”).text = itemData.held;
$w(“#IDElement”).text = itemData._id;
$w(“#documentElement”).link = itemData.document;
// Currently added code from here (NOT WORKING)
let linkToDisplayPage = dataItem[“link-references-_id-referrence-title”];
$w(“#displayElement”).onClick(() = {
wixLocation.to(linkToDisplayPage)
});
// Till here
const hasDoc = itemData.document;
if (hasDoc) {
$w(“#documentElement”).label = ‘Download Judgment’;
$w(“#documentElement”).enable();
$w(“#displayElement”).enable();
} else {
$w(“#documentElement”).label = ‘Judgment & details to be updated soon’;
$w(“#documentElement”).disable();
$w(“#displayElement”).disable();
}
});
Please guide what am doing wrong.
Thanking in anticipation.
Anupam Dubey