Question

Truncate text to 17 characters followed by 3 dots and hover need to display the complete text

Hi,

I have a requirement to truncate the long text to 17 characters followed by 3 dots and on hover need to display the complete text. can anyone suggest me the approach?

***Edited by Moderator Marissa to update platform capability tags****

Comments

Keep up to date on this post and subscribe to comments

Pega
June 18, 2019 - 9:10pm

Hi Ramakrishna,

Your requirement can be achieved by custom js, you can try below code to truncate the text as required.

if (label.length > 20){      

label = label.substring(0,17) + "...";

}

 

You can also try checking the configuration for designer studio tabs label, as it truncates the text of length more than 16 characters.

 

Thanks.

June 19, 2019 - 3:55am
Response to SusanLiu

Hi SusanLiu,

This is not worked for me.

Pega
June 21, 2019 - 5:23am

 

Hi Ramakrishna,

Your requirement can be achieved by using "pxTextAbridge" control where you can give max length as a parameter(Max length after which the text will be truncated).

Thanks