Multiline column type in Polygrid not working?

If you find an issue in LiveCode but are having difficulty pinning down a reliable recipe or want to sanity-check your findings with others, this is the place.

Please have one thread per issue, and try to summarize the issue concisely in the thread title so others can find related issues here.

Moderator: Klaus

Post Reply
paul@researchware.com
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 153
Joined: Wed Aug 26, 2009 7:42 pm
Contact:

Multiline column type in Polygrid not working?

Post by paul@researchware.com » Thu Nov 02, 2023 4:55 pm

In the image below (a Datagrid) I have programmed it so that multiline content is displayed in a scrolling field in a Datagrid cell.
MultilineDatagrid.png
I am trying to do something similar in a Polygrid. In the image below, the 3rd column, Notes, is set to multi-line text and the 2 cells have multi-line text, but none of the additional text is displayed?
MultilinePolygrid.png
MultilinePolygrid.png (6.64 KiB) Viewed 1688 times
Is there something about multiline text column type in the Polygrid I am not understanding? What should a Polygrid columnm where the "ContentType: in the PI is set to "text-multiline" actually look like (any one have a working example)?

Oddly, if you look up the pgColumns property in the LC Dictionary, 'columnIndex["contentType"] -- text|svg-lcname|svg-path|imagedata|imagefile|color|boolean|autoincrement|progress' has NO "text-multiline' option? Is this a missing Dictionary entry OR a Polygrid bug where "text-multiline" is present in the Property Inspector but not actually implemented?
Paul Dupuis
Researchware, Inc.

cpuandnet
Posts: 32
Joined: Thu Jan 17, 2019 6:43 am

Re: Multiline column type in Polygrid not working?

Post by cpuandnet » Fri Nov 03, 2023 6:17 am

Paul,

You need to increase the rowHeight property of the polygrid through the inspector or by script.

Tim

paul@researchware.com
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 153
Joined: Wed Aug 26, 2009 7:42 pm
Contact:

Re: Multiline column type in Polygrid not working?

Post by paul@researchware.com » Fri Nov 03, 2023 12:39 pm

Okay, I doubled the rowHeight (30 -> 60) which does show more lines, but not scrollbars within the cell to see the whole text of the cell.
doublerowheight.png
doublerowheight.png (10.08 KiB) Viewed 1665 times
This suggests to me that a developer needs to check each cell for a column than may have variable length, user entered or generated, text (so it could be any length from 0 to many many paragraphs) for the formattedHeight and or fromattedWidth of each cell and adjust the Polygrid accordingly to the maximum size to conrain the largest amount of text.

In essence there is not a way to give a cell scrollbars to allow the user to see larger amounts of text by scrolling.

If a cell has a contentType of "text-multiline" I personally would expect it to have scrollbars to show multiple lines (or at least the option to have scrollbars for seeing the excess text that does fit into the current width and height).
Paul Dupuis
Researchware, Inc.

stam
Posts: 3061
Joined: Sun Jun 04, 2006 9:39 pm

Re: Multiline column type in Polygrid not working?

Post by stam » Fri Nov 03, 2023 1:08 pm

Personally I find variable height rows aesthetically displeasing and even more so there if there is is long (and often small text size) text in a cell, or there are scrollbars in a cell - it doesn't really make for a clear and neat interface, and I rarely if ever see interfaces like this (but that's just me...)

Not knowing what your requirements are, potentially one way to tackle this is to
a) store the full text in a different array key
b) calculate length and if > 2 lines, truncate the text with ellipses so it fits in a 2-line field, and show that instead
c) implement a mechanism so if the user hovers or clicks on the 2 line text, you get a popover or some such that shows the full text, or alternatively set up a master-detail layout, if that's more appropriate.
d) You could give the user an option to show 1, 2 or 3 lines before truncation (MS Outlook does something similar)

That is a bit of extra work but end result may look nicer/more streamlined?

S.

paul@researchware.com
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 153
Joined: Wed Aug 26, 2009 7:42 pm
Contact:

Re: Multiline column type in Polygrid not working?

Post by paul@researchware.com » Fri Nov 03, 2023 3:50 pm

Stam,

Thank you for the suggestions. Our customers are good with the view shown in the forst screen shot in the first post (using a datagrid, cells with long text have scrollbars. This model lets the researchers adjust the row and/or column height to see enough of their data for most records depending upon their data.

The issue is that the Datagrid has other problems when used with user data where you can not predict what someone will be working with (an occasional data-dependent execution error deep in the datagrid drawing code). We had teh same occasional error in another datagrid table view that was remedied by replacing the datagrid with a polygrid. In that case, some researchers were working with datasets that created more than 300 columns in that view which exceeded the 32767px width limit of the datagrid. Polygrid has no such limitation. In this other case, the table view shown in the first post is a finite number of columns, so it is something else that we've not been able to track down. Our customer's data is often confidential and they are not willing to share it even to track down a bug.

I was looking for whether I could use the polygrid to replicate the datagrid "view" I already have. he answer is "not without some enhancement to the polygrid or a work-around to our app changing the user interface".

Thank you for your help.
Paul Dupuis
Researchware, Inc.

Post Reply