当前位置: 代码迷 >> Web前端 >> Ext4 MessageBox国际化有有关问题
  详细解决方案

Ext4 MessageBox国际化有有关问题

热度:110   发布时间:2012-08-30 09:55:54.0
Ext4 MessageBox国际化有问题

今天学习Ext4的过程中,有一个例子,是修改Ext.MessageBox默认的按钮文字

?

Ext.Msg.buttonText={
yes:’ yes’,
no:’no’,
ok:’ok’,
cancel:’cancel’
};
Ext.Msg.buttonText.yes=’Yes’;
var msgBox = Ext.MessageBox.show({
title:’提示’,
msg:’动态跟新的信息文字’,
modal:true,
buttons:Ext.Msg.OK
})
结果没有反应,后来上网查了一下才发现,Ext4的一个Bug,这里说得很清楚http://www.iteye.com/problems/67114,
  1. Ext.onReady(function(){??
  2. ????var?msgBox?=?Ext.MessageBox;??
  3. ????Ext.each(msgBox.msgButtons,?function(btn,?index){??
  4. ????????btn.setText(msgBox.buttonText[msgBox.buttonIds[index]]);??
  5. ????});??
  6. }); ?
  7. 执行这段话是可以国际化的,文章中,另外的一种方式没有试出来!

?