4 Replies Latest reply on Feb 13, 2011 11:29 AM by Shongrunden

    How do I stop List from cutting endings of items with '...'?

    BarryOgg

      Hi, this may be a bit dump question to ask, but I'm just starting with Flex, so:

      Regardless of what the item text's length is, last two letters are always cut off and replaced with '...' How can I stop this?

        • 1. Re: How do I stop List from cutting endings of items with '...'?
          BhaskerChari Level 4

          Hi Barry,

           

          This is the default behaviour of Flex label component which shows a '...' if there is no enough space for the text to fit..So in a tooltip you can see the whole text when you mouseOver on it..

           

          In order to avoid these either you need to make your List width large enough to fit all the labels size in your List or else you need to make use of an itemRenderer with a list making use of Text control.

           

           

          Thanks,

          Bhasker

          • 2. Re: How do I stop List from cutting endings of items with '...'?
            BarryOgg Level 1

            Thanks for your reply. However, when I try to use Text, I get the error "Could not resolve <mx:Text> to a component implementation. Here's the code:

             

            <?xml version="1.0" encoding="utf-8"?>
            <s:View xmlns:fx="http://ns.adobe.com/mxml/2009"
                    xmlns:s="library://ns.adobe.com/flex/spark"
                    xmlns:mx="library://ns.adobe.com/flex/mx" title="{data.title}"
                    creationComplete="srv.send()">
               
                <fx:Declarations>
                    <s:HTTPService id="srv" url="books/lowbooks/book{data.id}low.xml"/>
                </fx:Declarations>
               
               
                <s:List id="list" top="0" bottom="0" left="0" right="0"
                        dataProvider="{srv.lastResult.Book.Chapter}">
                    <s:itemRenderer>
                        <fx:Component>
                            <mx:Text
                                text="{data.title}"/>
                        </fx:Component>
                    </s:itemRenderer>
                </s:List>
            </s:View>

             

            And I have no idea what am I doing wrong.

            • 3. Re: How do I stop List from cutting endings of items with '...'?
              Andrei Kouzmenkov

              Sounds like it should complain first about <s:View>, at least I don't see s:View in Spark.

               

              Also as an idea, if you use MX item renderers like mx:Text  or mx:Label, they have truncateToFit property. Set it to false to avoid "..."

              • 4. Re: How do I stop List from cutting endings of items with '...'?
                Shongrunden Adobe Employee

                mx Components are not available in a Flex Mobile project.

                 

                If you want the best performance you should use one of the built in mobile ItemRenderers (MobileItemRenderer/MobileIconItemRenderer).  MobileItemRenderer will add ... by default.  What behavior are you looking for instead of ...?