<script type="text/javascript">
Ext.onReady(function(){
Ext.MessageBox.msgButtons[0].setText('按钮1');
Ext.MessageBox.msgButtons[1].setText('按钮2');
Ext.MessageBox.msgButtons[2].setText('按钮3');
Ext.MessageBox.msgButtons[3].setText('取消');
Ext.MessageBox.show({
title:'提示',
msg:'我是个丰富的弹出框',
modal:true,
buttons:Ext.Msg.YESNOCANCEL
});
});
</script>Ext版本是:4.2.1,运行效果如图所示,为什么按钮文字没有改变呢?Ext ExtJSjavascriptJS

解决方案 »

  1.   

    buttons:Ext.Msg.YESNOCANCEL
    这里已经指定了按钮类型了,只有:YES,NO,CANCEL三个
    把buttons:Ext.Msg.YESNOCANCEL注释掉试下
      

  2.   


            Ext.MessageBox.show({
            title:'提示',
            msg:'我是个丰富的弹出框',
            modal:true,
            buttons:Ext.Msg.YESNOCANCEL
            });
    Ext.MessageBox.msgButtons[0].setText('按钮1');
            Ext.MessageBox.msgButtons[1].setText('按钮2');
            Ext.MessageBox.msgButtons[2].setText('按钮3');
            Ext.MessageBox.msgButtons[3].setText('取消');你把顺序换一下,试试吧。
      

  3.   


    还真是啊!国内的WEB开发书籍真够水的,这例子真怀疑作者自己敲了没有,又或者难道在4.0的版本下可以写在上面???看来还是脑子不够灵活啊,结贴!