Preserving line breaks on Grid/cell?


I’m wondering if there’s a way where say users paste text that contain line breaks, and saving it or doing a getValue() would preserve the line breaks?



This is a test of



If you need same cell values without line breaks, you can delete all line breaks on server side you redefine getValue() of the cell.

I actually need the line breaks.

seems to get lost on the server side:

request.getParameter(id + “_cellName”);

Unfortunately it’s not clear in which use case you need to preserve the line breaks?
How the user will paste text that contain line breaks?
Which cell types are you using?
How data should be saved?
Why getValue() should return text without line breaks?

Retrieving the data server side is where it seems to lose the line breaks.

i tried type colType = ed, paste is there. And also tried colType = ro.

where i open a dialog with a textarea and assign the value to the cell.
the transfer from textarea doesn’t lose the line breaks.

it is when i retrieve it server side.

also, noticed there’s a maximum length of characters on the cell…which i’m not sure what number that is…


Hi all! I’m having the same issue with DHXgrid GPL v3.6.

On a cell type ‘ed’ I can write the text:

[i]This is a text

with a single

empty line

between lines.[/i]

But when I press outside the grid to accept my changes to the cell, it removes all the line-breaks I put there.
Additionally, when I re-edited, I notice it is only a single line proving I lost all inputted data in its original form.

I’m using:
enableKeyboardSupport(false) -> This is what allows me to input line breaks

What do I have to do to keep the user inputted line-breaks ??

There are separate column types for working with text. They will preserve newlines in the desired way. Try to use rotxt, edtxt or txttxt column types.

That didn’t help.

‘rotxt’ makes it unable to edit.

‘edtxt’ also doesn’t maintain the inserted line-breaks.

‘txtxt’ is not Inline Edit and also doesn’t maintain the inserted line-breaks.

If I were to custom the behaviour of the ‘ed’ type cell, what and where should I mess around ?

Please check the attached sample. (67.9 KB)

The sample you created uses the cell type “txt” and with that type (and only that) line-break works but my grid information and organization that the edition mode remains “Inline Edit” and that is why I’m currently using the ‘ed’.

I guess I’ll have to lose a feature if no solution is found…