Please anybody for assistance to fix this code. I cant find solution to expand and shortening dynamic texts in repeater.
let fullText; // variable to hold the full text
let shortText; // variable to hold the short version of the text
$w.onReady( function () {
const shortTextLength = 150;
fullText = $w(“#text263”).text //or whaterver text you want
shortText = fullText.substr(0, shortTextLength) + “…”;
$w(“#text263”).text = shortText;
});
export function button45_click(event, $w){
$w(“#repeater1”).forEachItem( ($w, itemData, index) => {
if ($w(“#text263”).text === shortText) {
$w(“#text263”).text = fullText;
$w(“#button45”).label = “Show less”;
} else {
$w(“#text263”).text = shortText;
$w(“#button45”).label = “Show more”;
}
}
}