Does show more widget work in Mendix 10?

0
Hi Experts! I had used a show more widget on my application which was on version 9.24.23. Now that since I have upgraded it to version 10.12, the widget doesn't seem to be working.  Has this widget been deprecated? if yes, then kindly suggest me a widget to achieve this functionality   Thanks and Regards, Simran.
asked
1 answers
0

Hi Simran,

you can achive this without widget as well if you know css & js, just put your text into a container and give class "text-container" and give text the class "text-content" and create a button wih class "show-more-btn" with buttoncaption "Show More"

use below styling it will initially show 3 lines as line-clamp is 3

.text-container {  position: relative;}

.text-content {  overflow: hidden;  display: -webkit-box;  -webkit-line-clamp: 3;  -webkit-box-orient: vertical;}

.text-content.expanded {  display: block;  overflow: visible;}

use below java script

setTimeout(function() {  const showMoreBtn = document.querySelector(".show-more-btn");  const textContent = document.querySelector(".text-content");

  showMoreBtn.addEventListener("click", function() {    textContent.classList.toggle("expanded");    const isExpanded = textContent.classList.contains("expanded");    showMoreBtn.textContent = isExpanded ? "Show Less" : "Show More";    showMoreBtn.classList.toggle("less", isExpanded);  });}, 1000);

Hope it helps!

answered