PDA

View Full Version : how to show messagebox with alot of line



dani_bs
6 Sep 2011, 12:14 AM
I need to show a messagebox. I use this code:


var msg = 'blablabla \n blablabla \n'
.replace(/\n/g, '<br />')
+ '<br />';

Ext.Msg.alert('Title', msg).setIcon(Ext.Msg.ERROR);


(blabla message is inside a variable filled by server request)
I need to substitute '\n' with '<br />' to have a new line, but if there are alot of new line the text is not aligned. I tried to wrap msg with <span> or <div> without success...

27871

skirtle
6 Sep 2011, 12:36 AM
Ext.Msg.show({
buttons: Ext.Msg.OK,
icon: Ext.Msg.ERROR,
msg: '...',
title: 'Title'
});

dani_bs
18 Oct 2011, 12:06 AM
After using:



Ext.Msg.show({
buttons: Ext.Msg.OK,
icon: Ext.Msg.ERROR,
msg: 'aaa<br/>aaa<br/>aaa<br/>aaa<br/>aaa<br/>aaa<br/>aaa<br/>aaa<br/>aaa<br/>',
title: 'Title'
});


I resolved my problem, but this was not true with long (alot of lines) messages. The messagebox is rendered in that way:



<div id="component-1002" class="x-component ext-mb-icon x-component-default x-dlg-icon ext-mb-question" style="float: left; width: 50px; height: 84px;" role="presentation"></div>


and the problem is:



height: 84px;


Incrementing the value with firebug the problem go away.
Please, fix it in the next release.


Daniele

dani_bs
18 Oct 2011, 1:48 AM
I found that the problem is with Firefox 7.0.1. With FF 3.6.23 the DIV with the image (icon) is corretly resized (more than 84px).


Daniele

skirtle
18 Oct 2011, 4:23 AM
You'll need to post a bug report to the Bugs forum.

dani_bs
19 Oct 2011, 12:06 AM
You'll need to post a bug report to the Bugs forum.

I did that, but someone moved my post:
http://www.sencha.com/forum/showthread.php?151268-how-to-show-messagebox-with-alot-of-line

skirtle
19 Oct 2011, 5:17 AM
You need to file a proper bug report. The way you reported it there reads like a question. There's a sticky at the top of the bugs forum explaining how to report a bug.