<script type="text/javascript">
Ext.onReady(function(){
/*
方法一:如果在配置对象中提供的信息不全就会出现按钮上没有文字的现象
即:buttonText定义的属性个数必须和buttons个数一致。
*/
//必须放在创建提示框之前
Ext.MessageBox.buttonText = {
yes: '是',
no: '否',
cancel: '取消'
};
Ext.MessageBox.show({
title: '提示',
msg: '改变按钮的文字',
modal: true,
buttons: Ext.Msg.YESNOCANCEL,
fn:function(id){
alert(id);
}
})
/*
方法二:
*/
Ext.MessageBox.buttonText.yes = '是';
Ext.MessageBox.buttonText.no = '否';
Ext.MessageBox.show({
title: '提示',
msg: '自定义按钮文字',
modal:true,
buttons: Ext.Msg.YESNOCANCEL
});
});
</script>
改变提示框按钮默认的文字
最新推荐文章于 2022-08-24 09:49:02 发布