How to change line in Ext.MessageBox message?
if (duplicatedRecords.length > 0) {
var msg = '';
duplicatedRecords.forEach(function(element) {
msg += ' - ' + element.get('ClientName') + '\n';
});
Ext.MessageBox.show(
{
title: 'Record(s) already exists',
msg: msg,
icon: Ext.MessageBox.ERROR,
buttons: Ext.Msg.OK,
closable: false
});
}
I've tried with '\n' and doesn't work...
How to change line in Ext.MessageBox message?
if (duplicatedRecords.length > 0) {
var msg = '';
duplicatedRecords.forEach(function(element) {
msg += ' - ' + element.get('ClientName') + '\n';
});
Ext.MessageBox.show(
{
title: 'Record(s) already exists',
msg: msg,
icon: Ext.MessageBox.ERROR,
buttons: Ext.Msg.OK,
closable: false
});
}
I've tried with '\n' and doesn't work...
Share Improve this question asked Sep 19, 2014 at 16:08 Joao AguasJoao Aguas 501 silver badge8 bronze badges 1-
In the dialog image, it looks like you're using
/n
instead of\n
. Is the framework you're using changing them or something? – APerson Commented Sep 19, 2014 at 16:10
2 Answers
Reset to default 6This is rendering HTML, so you can just add a 'br':
Sencha fiddle
Ext.MessageBox.show(
{
title: 'Record(s) already exists',
msg: "msg<br/>msg",
icon: Ext.MessageBox.ERROR,
buttons: Ext.Msg.OK,
closable: false
});
Message is just and HTML, so you can use <br>
if you want to do it manually.
If your text is big it will automatically wrap your text.
发布者:admin,转转请注明出处:http://www.yc00.com/questions/1745580444a4634223.html
评论列表(0条)