Hey,
I’ve been trying to solve this but there just seems to be an issue in getting the information of the dataset to display the right information… Ideally, the textbox would display the first 40 characters of the text and if we press on the button it would display all the text .
The following codes works in alternating between full-text/short-text commands but only displays the default value of the textbox (i.e. doesn’t display the real text from the dataset anymore)
–
let fullText; // variable to hold the full text
let shortText; // variable to hold the short version of the text
$w.onReady( function () {
const shortTextLength = 40;
fullText = $w(“#text46”).text
shortText = fullText.substr(0, shortTextLength) + “…”;
$w(“#text46”).text = shortText;
$w('#button13').onClick((event, $w) => {
let $item = $w.at(event.context)
$item(“#repeater3”).text = “Selected”;
if ($item(“#text46”).text === shortText) {
$item(“#text46”).text = fullText;
$item(“#button13”).label = “Show Less”;
} else {
$item(“#text46”).text = shortText;
$item(“#button13”).label = “Show More”;
}
})
})
Can anybody help me solve this?