CGDevTools Forum

Welcome to the Official CGDevTools Support Community Forums.

How to wrap text in data column

by bob9999 » 04 Sep 2019 18:07

Hi there. I have a grid that is loading a memo field formatted in HTML from the database and I want this to wrap the text in the grid column when viewing but what is occurring is this is just acting like a text field and just cutting off the text at the column end. When I use the edit feature there is a great text area edit type that allows wrapping. I want this same for the formatter but all I can find is a function or none for options.

Is there a trick in the function formatter to make the grid wrap text in a column? Otherwise, I will have to send the width of the column to the database and have the database wrap the text and baby feed the grid. I would have thought a word wrap would be a standard default setting for data feeding into the grid.

Cheers!
bob9999
 
Posts: 110
Joined: 18 Jan 2019 17:32

by bob9999 » 06 Sep 2019 18:19

I found a way to use the tag textarea but then the html is no longer formatted and I can see the tags in the field. Word wrapping successful but no formatting if I do this. Looks like this is a limitation in the grid where if you use raw and then feed into grid all is formatted but clipped. I am going to just strip the html tags from the data stream into a text area and then the user can just click to see fancy formatting if they want in a popup. If anyone has an idea to get the grid to work the nicer way, please let me know. Cheers!
bob9999
 
Posts: 110
Joined: 18 Jan 2019 17:32

by bob9999 » 09 Sep 2019 16:59

Unfortunately, the grid does not allow one column to be text area and another to be html and it is like the first test area column renders and then the second html one starts lower down making the whole row this wide fat thing with wasted space. Looks like the grid is just not capable of this level of customization. It would be nice to have the row auto grow to data contents instead of truncating the string. There is an adjustheighttorows setting but that is for whole grid and no row by row control. I see autowidth for a setting and no autoheight.

Cheers!
bob9999
 
Posts: 110
Joined: 18 Jan 2019 17:32

by Alexander Bulei » 16 Sep 2019 09:58

Hi bob9999,

You can handle it with div wrapper and css style.

Best Regards.
Group: Developers | Support Team

  • info [at] cgdevtools.com - General information
  • sales [at] cgdevtools.com - Sales department
  • support [at] cgdevtools.com - Product and Technical Support
User avatar
Alexander Bulei
Site Admin
 
Posts: 3635
Joined: 15 May 2012 08:52
Location: Mealhada, Portugal

by bob9999 » 16 Sep 2019 14:00

Oh, so you have to use CSS in the data from server for wrapper and then have style in CSS file. I seem to remember trying this but perhaps the style needs to be buried into the correct grid css hierarchy. allot of work to get the grid to do what it should by default. yikes. Thank you for this Alex. It is really helpful though.
bob9999
 
Posts: 110
Joined: 18 Jan 2019 17:32


Return to JQGrid

Who is online

Users browsing this forum: No registered users and 2 guests

Contact Us.