javascript - How to change line in Ext.MessageBox message? - Stack Overflow

How to change line in Ext.MessageBox message?if (duplicatedRecords.length > 0) {var msg = '

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
Add a ment  | 

2 Answers 2

Reset to default 6

This 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条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信