0

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?

abarisone
  • 3,707
  • 11
  • 35
  • 54
Mauro Tamm
  • 370
  • 2
  • 19
  • So, if I understand your situation, you have HTML strings that come from the db and you want them correctly rendered into the TextArea? – abarisone Mar 23 '15 at 10:51
  • not html specifically - its a string created with a loop. But i need each of the iterations from the loop to show up on a separate line for readability. Each iteration would have something like $string .= "param: old -> new" - with a line break/new line at the end of each of those. These created strings are stored in database. – Mauro Tamm Mar 23 '15 at 11:25

1 Answers1

0

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().

Mauro Tamm
  • 370
  • 2
  • 19