如何在ExtJS中更改LoadMask文本

如何在ExtJS中更改LoadMask文本,extjs,extjs4,extjs-mvc,Extjs,Extjs4,Extjs Mvc,有没有办法在ExtJS 4.1 MVC应用程序上全局更改Ext.LoadMask.msg // changing the msg text below will affect the LoadMask Ext.define("Ext.locale.##.view.AbstractView", { override: "Ext.view.AbstractView", msg: "Loading data..." }); 在大多数情况下。在onReady()函数的后面/内部调用此函

有没有办法在ExtJS 4.1 MVC应用程序上全局更改
Ext.LoadMask.msg

// changing the msg text below will affect the LoadMask
Ext.define("Ext.locale.##.view.AbstractView", {
    override: "Ext.view.AbstractView",
    msg: "Loading data..."
});
在大多数情况下。在onReady()函数的后面/内部调用此函数。将##设置为您的语言环境

var myMask = new Ext.LoadMask(myPanel, {msg:"Please wait..."});
myMask.show();

在onReady函数中添加类似的内容:

if (Ext.LoadMask) {
    Ext.apply(Ext.LoadMask.prototype, {
        msg: 'Загрузка...'
    });
}
或者在您的区域设置中类似于此。**文件:

Ext.define("Ext.locale.**.LoadMask", {
    override: "Ext.LoadMask",
    msg: "Загрузка..."
});

这适用于我。

这一项仅适用于特定组件。在您的情况下-
myPanel
。我正在搜索整个应用程序的全局解决方案。使用Ext.getBody()获取整个窗口。在代码中的适当位置调用此函数。然后将值传递给LoadMask(),我的应用程序中有很多
LoadMask
s。我应该为我所有的面具调用这个方法?这是我认为的唯一方法。。如果您需要在单个排序时更改消息,那么我觉得您需要重写LoadMask方法。但是更好的方法是创建一个类似mask:function(body,msg){new Ext.LoadMask(body,msg)}的函数,并在需要的地方调用这个函数。我试着从我的
视图
MVC文件夹中放置并加载它。没有效果。@webband您只是在MVC应用程序中已经有了一个默认值,但您可以有第二个用于本地化。我的帖子中代码框下方写的
#
@AshwinP是什么意思:
将##设置为您的语言环境
Ext.define("Ext.locale.de.view.AbstractView", {
override: "Ext.view.AbstractView",
loadingText: "Uebertrage Daten..." });