Announcement

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

    ListGrid records with string value containing "\r\n" expands ListGrid row

    SmartClient Version: v9.1p_2015-09-16/Pro Development Only (built 2015-09-16)
    Any browser, any version

    Putting in line breaks (\r\n) in a record field value causes the ListGrid to expand the height of the row containing that data. We do not want this because it displays inconsistent height with ListGrid record. How would we cause the row containing the line breaks to stay the same height as every single-line row?

    The demo will require a data source and a local data that contains \r\n line breaks in the string value.

    JavaScript:
    Code:
      isc.ListGrid.create({
          ID:"dsListGrid",
          width: "100%",
          height: "100%",
          minFieldWidth:80,
          autoFetchData: true,
          dataSource: "showcase_ListInfo"
      });
    JSON data:
    Code:
      [
          {
              "hidden":"hiddenText1",
              "enum":"na",
              "dateTime":"2009-04-24T06:07:20-04:00",
              "number":10,
              "float":1.0,
              "boolean":true,
              "image": "ok",
              "link": "[URL="http://www.google.com/"]http://www.google.com[/URL]",
              "showIf":8,
              "string": "Text1\r\nText2\r\nText3\r\nText4\r\nText5\r\nText6\r\nText7\r\nText8\r\n"
          },
          {
              "hidden":"hiddenText2",
              "enum":"na",
              "dateTime":"2009-05-24T06:07:20-04:00",
              "number":10,
              "float":1044444.05555555,
              "boolean":false,
              "image": "exclamation",
              "link": "[URL="http://www.abc.com/"]http://www.abc.com[/URL]",
              "showIf":1,
              "string": "N/A"
          }
      ]

    #2
    Data like that won't actually cause row expansion, as you can see by editing the data live in a sample like this one.

    Your test case is incomplete - we're guessing that in your real code, you might be adding <br> elements (or have added formatting logic to translate the \r\n to <br> elements). This *would* cause expansion of rows by default in some browsers, and you can set enforceVClipping:true to prevent this (it's not on by default because enforcing vertical clipping in this relatively rare case requires extra, more expensive HTML structure).

    Comment

    Working...
    X