PDA

View Full Version : Ext.Msg.alert doesn't render newline properly



Syed Huda
13 Jan 2011, 9:50 AM
Hi,

Here's my old code using regular text box:


alert(responseObject.responseText);

which renders the alert box properly, with newlines for each "\n", so that it looks like a list of errors:
file:///C:/DOCUME%7E1/SYED_H%7E1/LOCALS%7E1/Temp/moz-screenshot.png24268

Here's my new code, since I need a title for the alert box I use Ext.Msg.alert:

Ext.Msg.alert('Error',responseObject.responseText);

But this doesn't do newlines for every "\n" in the responseText:
24269

How can I get the effect of a regular javascript alert in extjs.msg.alert ??

fay
13 Jan 2011, 10:20 AM
Replace '\n' with '<br />'

See: http://www.sencha.com/forum/showthread.php?3042-Newline-equivilent-in-Ext.MessageBox.alert() (http://www.sencha.com/forum/showthread.php?3042-Newline-equivilent-in-Ext.MessageBox.alert)

Syed Huda
13 Jan 2011, 10:47 AM
thanks it works.