Placeholder text for MessageBox

泄露秘密 提交于 2021-01-29 15:03:51

问题


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?


回答1:


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');
    


来源:https://stackoverflow.com/questions/65789677/placeholder-text-for-messagebox

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!