MessageBox的占位符文本 [英] Placeholder text for MessageBox

查看:141
本文介绍了MessageBox的占位符文本的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试通过提示符为MessageBox中的文本区域应用占位符文本,但似乎没有显示.

I am trying to apply a placeholder text for the textarea in the MessageBox via prompt but it doesn't seem to show.

到目前为止,这是我的代码:

Here's my code so far:

Ext.Msg.show({
            title: 'Approve Confirmation',
            message: 'Confirm to approve the selected items?',
            multiline: 'true',
            prompt:{
                placeHolder:"PLACEHOLDER TEXT HERE",
            },
            iconCls: 'fa fa-check-square-o',
            buttonText: {
                ok: 'Yes',
                cancel: 'No'
            },
            height:350,
            width:500,
            defaultTextHeight:210,
            fn:function(btn,text){
                //http processes
            }
        });

有关如何操作的任何提示?

Any tips on how to do so?

推荐答案

设置TextArea的emptyText属性,如下所示:

Set the emptyText property of the TextArea, like this:

var myMsg = Ext.Msg.show({
                title: 'Approve Confirmation',
                message: 'Confirm to approve the selected items?',
                multiline: 'true',
                prompt:{
                   placeHolder:"PLACEHOLDER TEXT HERE",
                },
                iconCls: 'fa fa-check-square-o',
                buttonText: {
                    ok: 'Yes',
                    cancel: 'No'
                },
                height:350,
                width:500,
                defaultTextHeight:210,
                fn:function(btn,text){
                       //http processes
             }
    });

    //Set emptyString
    myMsg .textArea.setEmptyText('My Message');
    

这篇关于MessageBox的占位符文本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆