Ext.define('aw.grid.PagingToolbar', {
extend: 'Ext.toolbar.Paging',
alias: 'widget.custompaging',
displayInfo: true,
items: [
{
xtype: 'combobox',
store: ['5', '10', '15', '20'],
width: 50,
queryMode: 'local',
allowBlank: false,
editable: false,
triggerAction: 'all',
maskRe: /[0-9]/,
listeners: {
init: function (paging) {
debugger;
var me = this;
paging.on('afterrender', me.onInitView, me);
},
onInitView: function (paging) {
var me = this;
me.setValue(paging.store.pageSize);
for (var i = 0; i < paging.items.length; i++) {
if (paging.items.items[i].xtype == 'tbfill') {
paging.remove(paging.items.items[i]);
paging.add(i, me);
}
}
me.on('select', me.onPageSizeChanged, paging);
me.on('specialkey', function (combo, e) {
if (13 === e.getKey()) {
me.onPageSizeChanged.call(paging, me);
}
});
},
onPageSizeChanged: function (combo) {
var me = this;
me.store.pageSize = parseInt(combo.getRawValue(), 10);
me.doRefresh();
}
}
},
{
xtype: 'button',
text: 'x - Rows selected'
}
]
});
The problem i have is that my listeners are not working ...and i dont know how to make this work...i dont know if its okey like this ..
Override Pagingtoolbar and add combbox item.
Aucun commentaire:
Enregistrer un commentaire