问题
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