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,
- Ext.onReady(function(){??
- ????var?msgBox?=?Ext.MessageBox;??
- ????Ext.each(msgBox.msgButtons,?function(btn,?index){??
- ????????btn.setText(msgBox.buttonText[msgBox.buttonIds[index]]);??
- ????});??
- }); ?
- 执行这段话是可以国际化的,文章中,另外的一种方式没有试出来!
?