extjstextareaext3

Ext 3.4 TextArea new line in string with setValue()


I have a basic ExtJs textarea with setValue. The value comes to ExtJs as a string from database.

The string is created in php. Since it doesn't support HTML, <br> won't work.

It also seems to ignore \r\n or \n or \ \r\ \n or \ \n - it will simply print it as text.

Is there any workarounds?


Solution

  • It seems like ext somehow escaped everything when the datatype in store was string (i guess some ASCII values were set).

    Adding string directly to setValue() works with \n.

    As a workaround i used a custom palceholder %nl and used js replace to change them to \non setValue().