`
ghl116
  • 浏览: 161449 次
  • 性别: Icon_minigender_1
  • 来自: 上海
社区版块
存档分类
最新评论

Ext4 MessageBox国际化有问题

ext 
阅读更多

今天学习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. 执行这段话是可以国际化的,文章中,另外的一种方式没有试出来!

 

分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics