在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);
最佳答案
我相信您的beforePageText
实际上应该是:
beforePageText: '{מתוך {0',
它无法正确匹配
0}
。关于javascript - ExtJS右转左,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/5146118/