Addin Ellipsis

0
Hello everyone, I am creating a native mobile application, and I have a text inside a container, this is too long, in a web application I was able to add a CSS function to add an ellipsis if the text was passed, however in native it is different Does anyone know how to carry out my incident?   I tried to do this, but it doesn't do anything
asked
1 answers
1

Hello, 

 

In ReactNative, there's a property called ellipsizeMode and another called numberOfLines that can be used together to achieve the desired result.

However, these properties are not available in the Mendix Text widget.

 

In this scenario, 2 possibilities:

  1. Use the component from MxTechies React Line Ellipsis [EDIT: This is for web apps - so you have only the option 2 or create your own ReactNative Text Widget with this feature]
  2. Use a Helper NPE (that define the Text and the Limit) and a custom expression to truncate the Text (see below)

image.png

 

if length($currentObject/Text) > $currentObject/Limit 
then
    substring($currentObject/Text,0, $currentObject/Limit-3) + '...'
else 
    $currentObject/Text

 

answered