PDA

View Full Version : I find one bug In local file



cntysoft
1 Oct 2011, 6:29 PM
web I load ext-lang-zh_Cn
if(Ext.MessageBox){ Ext.MessageBox.buttonText = {
ok : "??",
cancel : "??",
yes : "?",
no : "?"
};
}
but Ext.MessageBox is a instance of Ext.window.MessageBox,Ext.MessageBox.buttonText is used in initComponent function,so the Ext.MessageBox.buttonText in ext-lang-zh_Cn can not be used.~~~ i am sorry, my english is very bad,this is my first post...

cntysoft
1 Oct 2011, 7:04 PM
here is my fix , not very beautifull, but it works!!


Ext.define('Cntysoft.Extend.Window.MessageBox',{
extend : 'Ext.window.MessageBox',
/**
* ?????
* @var boolean
*/
fixed : false,
reconfigure : function (cfg){
var me = this;
/**
* ??????
*/
if (!me.fixed){
Ext.each(me.buttonIds,function (id){
/**
* Ext.MessageBox.buttonText[id] ????? ??????????
*/
me.msgButtons[id].setText(Ext.MessageBox.buttonText[id]);
});
me.fixed = true;
}
me.callParent([cfg]);
}
},function (){
Cntysoft.MessageBox = Cntysoft.Msg = new this();
});