Extjs 4.2使用组合框项目的分页工具栏

时间:2014-09-22 08:35:31

标签: javascript extjs4 extjs4.2

为什么这不起作用,没有做任何事情,它只是向我展示了带存储的组合框..但我的功能正在起作用.. :(

 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'
    }
]
});

这用于其他页面,但我不知道为什么我的功能不起作用甚至没有调试器.. :((

0 个答案:

没有答案