ExtJS RightToLeft

时间:2011-02-28 18:39:45

标签: javascript extjs

在ExtJS中我需要更改afterPageText和beforePageText的位置,下面的代码是我用来扩展的类,因为ExtJS缺少rtl支持,因此我需要在输入框之前写入总页数而不是之后但我得到的只是普通的beforePageText而没有总数。感谢您提前帮助

Ext.namespace("Spc");    
Spc.HebPaging = Ext.extend(Ext.PagingToolbar, {
    initComponent: function(){
        var T = Ext.Toolbar;
        var config = {
                displayInfo: true,
                displayMsg: 'מוצג {0} - {1}, מתוך {2} ערכים',
                emptyMsg: "אין ערכים להציג",
                beforePageText: 'מתוך {0}',
                afterPageText: 'עמוד'
        };

        var pagingItems = [this.first = new T.Button({
            tooltip: this.firstText,
            overflowText: this.firstText,
            iconCls: 'x-tbar-page-first',
            disabled: true,
            handler: this.moveFirst,
            scope: this
        }), this.prev = new T.Button({
            tooltip: this.prevText,
            overflowText: this.prevText,
            iconCls: 'x-tbar-page-prev',
            disabled: true,
            handler: this.movePrevious,
            scope: this
        }), '-', this.beforeTextItem = new T.TextItem({
            text: String.format(this.beforePageText, 1)
        }),
        this.inputItem = new Ext.form.NumberField({
            cls: 'x-tbar-page-number',
            allowDecimals: false,
            allowNegative: false,
            enableKeyEvents: true,
            selectOnFocus: true,
            submitValue: false,
            listeners: {
                scope: this,
                keydown: this.onPagingKeyDown,
                blur: this.onPagingBlur
            }
        }), this.afterPageText,
        '-', this.next = new T.Button({
            tooltip: this.nextText,
            overflowText: this.nextText,
            iconCls: 'x-tbar-page-next',
            disabled: true,
            handler: this.moveNext,
            scope: this
        }), this.last = new T.Button({
            tooltip: this.lastText,
            overflowText: this.lastText,
            iconCls: 'x-tbar-page-last',
            disabled: true,
            handler: this.moveLast,
            scope: this
        }), '-', this.refresh = new T.Button({
            tooltip: this.refreshText,
            overflowText: this.refreshText,
            iconCls: 'x-tbar-loading',
            handler: this.doRefresh,
            scope: this
        })];

        Ext.apply(this, Ext.apply(this.initialConfig, config));
        Spc.HebPaging.superclass.initComponent.apply(this, arguments);
    }
});

Ext.reg('Heb-Page', Spc.HebPaging);

1 个答案:

答案 0 :(得分:0)

我相信你的beforePageText实际上应该是:

beforePageText: '{מתוך {0',

无法正确匹配0}