Questions with textarea editor in grid

Hi all,

I just use textarea in grid.

  1. in my snippet, i don’t understand why the maxWidth on the column comment change the size of the column (i just want to avoid more that 80 cars in the column, and it seem doing it)
    https://snippet.dhtmlx.com/eo9dajfj
    what is best way to prevent oversize ?

  2. in addition, is there a way to make carriage return in textarea (so having many lines)
    → ok, found it : shift Enter

thx

Sorry, I seem don’t get the issue.
maxWidth property allows to define the maximum allowed width for the column in pixels.
so, it is just what is needed for you - prevent oversize.
Could you please, clarify your issue?

1. in addition, is there a way to make carriage return in textarea (so having many lines)
→ ok, found it : shift Enter

Right. Also, you can use \n in your cell value to define a line break.

Hi sergey,

in the snippet,

i can put the following text in a comment cell…and there is more than 80 chars

0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789

so there is oversize

My apologies, but there is no any oversize:


the column is still 80 px in width.

Could you please, clarify the issue?

sorry,
my question was not clear. my question doesn’t concern the visibility of the cell but the input limitation.

How can i limit in an editable cell of a grid (editorType=“textarea” or “input”) the maximum number of characters a user can put?

in form, for input, we have the maxlength property. but it don’t seem working in input grid.

ok, I see. maxWidth property defines the maximum width of a grid column in pixels. This property is not related to the content of a cell.

There is no maxLength property for the grid cell.
You may prevent the user to input more than ‘n’ symbols using the AfterEditStart event. Something like:
https://snippet.dhtmlx.com/ss5rxx2i

ok that’s work has expected
thx