Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    ListGrid cell level wrapping not working

    I知 using SmartGWT 5.1-p20170201 on Firefox 26.0 on Windows.

    I am trying to have a single cell have wrapping in a list grid. I知 using the method ListGridField.setWrap(true).

    Text in the cell does not wrap.

    Here is my test code

    Code:
    [B]public[/B] [B]class[/B] ListgridCellWrapEntry [B]extends[/B] ListGrid [B]implements[/B] EntryPoint {
        [B]private[/B] [B]static[/B] [B]final[/B] String [B][I]WRAP[/I][/B]        = "wrap";
     
        [B]private[/B] [B]final[/B] List<String>  wrapContent = Arrays.[I]asList[/I]("Assertively deploy synergistic experiences",
                "Synergistically orchestrate cross-media synergy", "Collaboratively optimize future-proof services",
                "Holisticly strategize 24/7 collaboration and idea-sharing", "Energistically harness progressive fungibility",
                "Globally maximize orthogonal infomediaries", "Dynamically aggregate client-centric total linkage",
                "Objectively harness value-added outsourcing", "Credibly disintermediate efficient markets");
     
        @Override
        [B]public[/B] [B]void[/B] onModuleLoad() {
            show();
            setFields([B]new[/B] ListGridField([B][I]WRAP[/I][/B]) {
                {
                    setWidth(150);
                    setWrap([B]true[/B]);
                }
            });
     
            setData(wrapContent.stream()
                               .map(text -> {
                                   ListGridRecord record = [B]new[/B] ListGridRecord();
                                   record.setAttribute([B][I]WRAP[/I][/B], text);
                                   [B]return[/B] record;
                               })
                               .toArray(ListGridRecord[]::[B]new[/B]));
        }
    }

    #2
    This text looks like, depending on your skin, it would fit in the field without needing to wrap. Text which fits in the field doesn't wrap (by design).

    Comment


      #3
      Originally posted by Isomorphic View Post
      This text looks like, depending on your skin, it would fit in the field without needing to wrap. Text which fits in the field doesn't wrap (by design).

      I知 confused by this response.

      Are you saying that you decided the code is working correctly just by looking at it?

      Did you run the provided example?

      Even if the provided example doesn稚 wrap in your environment, then you could just increase the size of the text until either it wrapped or truncated to determine if there was a bug or not.

      I have provided a screen shot showing that it does not wrap for me.
      Attached Files

      Comment


        #4
        Sorry for the confusion here - we misunderstood what you were asking.
        Unlike listGrid.wrapCells, the ListGridField "wrap" property governs whether the field title wraps, not whether cell values wrap.

        There is currently no field level property to enable / disable wrapping of cell content per field. This may be something we could add as a feature sponsorship. If you'd like us to take a look at what's involved, let us know and we can get back to you with an estimate.

        Alternatively, you could achieve the desired result by enabling wrapping of cells within your grid as a whole - but using cellValueFormatters to write out explicit non-wrapping HTML (using css, or simple NOBR tags around the cell values) for fields where you want wrapping suppressed.

        Regards
        Isomorphic Software

        Comment

        Working...
        X