Show only first part of a large text field on a grid

If you have questions or if you want to share your opinion about Aware IM post your message on this forum
Post Reply
Jhstephenson
Posts: 297
Joined: Wed Apr 22, 2015 11:44 pm

Show only first part of a large text field on a grid

Post by Jhstephenson »

I have a large text field that I only want to show the first 60 characters of on a grid.

How do I do that?

Alternatively the question might also be, how do I keep the row to only one line instead of expanding to fit all of lines of text in the attribute?

Thanks,
Jim
Jaymer
Posts: 2457
Joined: Tue Jan 13, 2015 10:58 am
Location: Tampa, FL
Contact:

Re: Show only first part of a large text field on a grid

Post by Jaymer »

that must be an html field?
maybe 1 of these will work:
either have a copy of it in another field (using a rule) thats not marked as HTML, or use the new 8.1 function to make a calculated column and show that?

but an html field shown in regular text field will show all the html markup (looks ugly maybe to a user). a PATTERN_REPLACE could remove tags.

jaymer...
Click Here to see a collection of my tips & hacks on this forum. Or search for "JaymerTip" in the search bar at the top.

Jaymer
Aware Programming & Consulting - Tampa FL
mrbdrm
Posts: 349
Joined: Tue Oct 16, 2012 11:44 am

Re: Show only first part of a large text field on a grid

Post by mrbdrm »

if your using custom query you can use css style to show only part of the text
Jhstephenson
Posts: 297
Joined: Wed Apr 22, 2015 11:44 pm

Re: Show only first part of a large text field on a grid

Post by Jhstephenson »

Does the CSS Style only work with a custom query?

I am running this from a Tabbed section of a BO form.

I tried putting the following into the CSS Style for the Grid:

.k-grid tbody tr{ height: 50px;} .k-grid td{white-space: nowrap;}

But it didn't seem to have any effect.
customaware
Posts: 2405
Joined: Mon Jul 02, 2012 12:24 am
Location: Ulaanbaatar, Mongolia

Re: Show only first part of a large text field on a grid

Post by customaware »

In 8.1 I think you could use a dynamic column.

CHARS_FROM_LEFT(MyBO.MyString,60)

just a thought
Cheers,
Mark
_________________
AwareIM 6.0, 8.7, 8.8, 9.0 , MariaDB, Windows 10, Ubuntu Linux. Theme: Default, Browser: Arc
Upcloud, Obsidian....
Image
aware_support
Posts: 7525
Joined: Sun Apr 24, 2005 12:36 am
Contact:

Re: Show only first part of a large text field on a grid

Post by aware_support »

You can do it with a CSS for a standard query. But I forget the actual values off the top of my head - you can Google for them. The CSS you have tried doesn't seem right. It has something to do with "ellipsis"
Aware IM Support Team
mrbdrm
Posts: 349
Joined: Tue Oct 16, 2012 11:44 am

Re: Show only first part of a large text field on a grid

Post by mrbdrm »

Code: Select all

white-space: nowrap;text-overflow: ellipsis;-o-text-overflow: ellipsis;overflow: hidden;
Jhstephenson
Posts: 297
Joined: Wed Apr 22, 2015 11:44 pm

Re: Show only first part of a large text field on a grid

Post by Jhstephenson »

mrbdrm, should this be entered in the custom css file or will it work by entering it directly into the CSS Style property of the Query?
Jhstephenson
Posts: 297
Joined: Wed Apr 22, 2015 11:44 pm

Re: Show only first part of a large text field on a grid

Post by Jhstephenson »

Mark, your dynamic column suggestion worked.

I think I still want to see if I can get the CSS Style suggestion to work too though because I can see some other uses for it.
mrbdrm
Posts: 349
Joined: Tue Oct 16, 2012 11:44 am

Re: Show only first part of a large text field on a grid

Post by mrbdrm »

it will work directly with inline style .
Post Reply