Data grid does not display multiline text data

First time reporting a bug? Refer to our Start Here post.


Team ID:
(Glide)

App ID:
(Glide)

Description
I have a multi line data field and when I display it in a data grid it only displays the first line.

How to replicate

  1. Create a table with a couple of text field say Description.
  2. In the layout create a TextEdit component for Description.
  3. In the same layout create a data grid which includes the Description field
  4. enter some multiline input into the Description field

As an aside:
One might ask why do this. My problem is I want to display a variable number of names in a data grid along with some other related information. This could be anywhere from 5 to say a 100 names. It is not practical to create a field for each name and I do not know the maximum number of names. So I wrote some JavaScript to put the names in rows of 5 names that are blank filled and separated them by a vertical bar (pipe symbol). Counting on the fact that the data grid is using a fixed width font this would then look sort of like columns of data. Mmm… did not work (see Format Team field in pic)

That’s a lot of information to pull into a data grid. :slight_smile:

What kind of behaviour would you expect with a value of that size?

Not sure what you mean by behaviour? Do you mean speed of response?

I currently pull a 3 fields into a data grid and it has 30 records. The performance if fine.

I currently can put 30 names in the one field and one row - it works fine. Typically, I might have this on 5 different rows (so 150 names). The issue is that the actual display of the data is only on one line. Which makes it very difficult to view because of the width of the field (30 names). So data grid behaviour can more than likely handle the data size. My issue is the new lines in the text do not display properly. It basically truncates the string at the first newline, unlike a text component.

@NoCodeAndy I think what I’m understanding is that he wants the cell to dynamically expand vertically if text in a single cell has newline characters that cause it to wrap the text. Right now it won’t expand to display any wrapped text after the newline character.

After watching Jason’s video about how the grid canvas works, I’d be hesitant to think that it’s even possible to achieve something like that unless the cell height increases equally for each row, which could lead to a lot of extra white space in several rows.

@Gary_Biagioni if this is for display purposes only, I’d be a lot more inclined to build it out as an HTML table in a rich text component instead. You’ll probably get something that looks a while lot better and you could technically convert your pipe delimited names into individual stacked cells of 3. It would take a bit to build it out, but I definitely think it’s possible. Probably would be easiest to pump it all into a javascript columns that returns the HTML table.

2 Likes

@Jeff_Hager awesome description of what I want. I would have thought it would have been as simple as using a text display inside the cell but I guess not.

The HTML is a great idea, someday (in a few months) when I have nothing to do I may try it. For now, I think I can leave the names off this particular display. In another area of the app, where I really do need the names displayed, I do have a fixed number of fields and I can display it using fields (just 6 of them).

Thanks for the help, once again. The Calgary Canoe Club thanks you as well.

And just so the Glide Team knows the app I built during covid (and this one is an enhancement) probably allowed the Club to stay open and keep people safe. It worked so well the manager does not want to give it up, saves them a lot of time each day. SO thanks to the Glide team. The product is pretty awesome.

2 Likes

Yeah, I don’t think I can explain it easily or correctly so I won’t even try, but to my understanding, the grid consists of two layers to display properly and allow off screen data to render quickly as you scroll. To properly account for positions in virtual space, I’m guessing the cell height needs to be consistent across all rows, because some offscreen data may not be loaded until needed. It’s confusing and fascinating at the same time. Basically easier said than done.

When you are ready, let us know. I don’t think it would be terribly complicated. Mostly template columns to build each HTML table row, a joined list to merge them all together and another template column to wrap it all up. Where it might get complicated depends on how you want to display the names, but it’s still doable.

Thanks.

The magic is why I use the product and do not develop it :joy:. But I love the data grid and second best fields. Such big work safers

For me you can probably call this a work around solution which is good enough. I am not sure how bugs get tracked/resolved/closed etc.

1 Like

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.