ExtJS RightToLeft
In ExtJS I need to change the places of afterPageText and beforePageText the code below is the class I'm using to extend, because ExtJS is lacking rtl support and thus I need the total number of pages to be written before the input box and not after but all I get is just the plain beforePageText without the total number. Thanks for helping in advance
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.But开发者_JAVA技巧ton({
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);
I believe your beforePageText
should in fact be:
beforePageText: '{מתוך {0',
It wouldn't be able to match 0}
properly.
精彩评论