以马拉地语显示标签

时间:2010-03-08 13:49:27

标签: extjs label non-english

我想以马拉地语显示标签 我正在创建marathi.js 这是我的mararhi.js

if(Ext.app.formPanel) 
{
     Ext.apply(Ext.app.formPanel.prototype, 
                      {
                       selectUser:'नाव'
                      }
     );
}

我的其他js文件包含此

var Ext.app.formPanel = Ext.extend(Ext.form.FormPanel,{
     selectUser:'Select User',
     initComponent : function(config) {
                 Ext.apply(this, {
                           title      : 'User Rights',
                           bodyStyle  : 'padding: 10px; background-color: #DFE8F6',
                           labelWidth : 100,
                           width      : 755,
                           id         : 'formUserRights',
                           renderTo:'adminpanel',
                           items      : [   id: 'User',
                                        fieldLabel:this.selectUser,
                                        width:200
                            ] //items
                 });//Ext.apply
                 Ext.app.formPanel.superclass.initComponent.apply(this, arguments);
         }//init component
}); //yuyu
......
....

但它不起作用 它给出了错误; missing before var Ext.app.formPanel = Ext.extend..... 但是当我仔细检查所有东西时,每件东西都是正确嵌套的。

1 个答案:

答案 0 :(得分:0)

首先, vava 在上面的评论中提到的语法错误。

其次,你不应该 var 'Ext.app.formPanel' namespace

第三, initComponent 不传递任何参数。

第四,你需要调用超类,而不是应用它 - 也不需要传递参数,因为没有。

Ext.ns('Ext.app');
Ext.app.formPanel = Ext.extend(Ext.form.FormPanel, {
selectUser : 'Select User',
initComponent : function() {
    Ext.apply(this, {
        title : 'User Rights',
        bodyStyle : 'padding: 10px; background-color: #DFE8F6',
        labelWidth : 100,
        width : 755,
        id : 'formUserRights',
        renderTo : 'adminpanel',
        items : [ {
            id : 'User',
            fieldLabel : this.selectUser,
            width : 200
        } ]
    });
    Ext.app.formPanel.superclass.initComponent.call(this);
}
});

另外,我不想在我的应用程序代码中使用Ext命名空间,因此有可能发生冲突。我建议你创建自己的命名空间。

在房子里享受这一个,希望有一天你会真正给出答案。