"myGrid.setValue('value')" removing line breaks and extra spaces from cell text for "RO" cell


#1

Hi @sematik ,

We are trying to provide truncate text functionality for a cell in dhtmlx 4.4.
So when rendering grid initially, we are showing the first 255 characters of the data which is to be rendered in the cell and providing “Show More” link. When you hit this “Show More” link, it makes a db call and fetches all the data related to that cell and using “myGrid.setValue(‘value’)” method we are setting the value in that particular cell, and providing “Show less” link. This “Show less” link will again show only first 255 characters along with “Show More” link.

The problem here is we are using columnType as “ro” for that particular cell, and when we call “myGrid.setValue(‘value’)” method, it removes all the extra whitespaces and line breaks from the text, Please see the attached images for better understanding.
But “myGrid.setValue(‘value’)” works fine with “txt” columntype cell.

Could you please suggest on this.


#2

Pleas,e try to use the “rotxt” column type instead of the “ro”