日期:2014-05-16  浏览次数:20452 次

新学EXTjS,为什么没有例子出的效果?

<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 ?ExtJS javascript JS

------解决方案--------------------

        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('取消');

你把顺序换一下,试试吧。