ExtJs Ext.PagingToolbar:隐藏或设置刷新按钮的参数onclick?

JoJ*_*gel 3 extjs refresh hide

没有自定义的刷新按钮设置,所以我试图隐藏/删除它. hideRefresh: true不适合我.

如果没有办法隐藏它,我可以在单击按钮时至少传递一些参数,这样我可以让它做一些有意义的任务吗?

pPanel = new Ext.Panel({
    applyTo: 'newProgWin',
    autoScroll:true,
    styleClass: 'formInput',
    bodyStyle: 'overflow-x: hidden',
    align: 'center',
    layout:'fit',
    width:899,
    height:450,
    closeAction:'hide',
    plain: true,
    items: winDataView = new Ext.DataView({
        tpl: resultTpl,
        store: npDs,
       itemSelector: 'div.search-item'
    }),

    tbar: [
                'Search: ', ' ',
            (winSearchField = new Ext.ux.form.SearchField({
                store: npDs,
                width:300
            }))
        ],
    bbar: new Ext.PagingToolbar({
                beforeLoad : function()
                {
                    pocProxy.extraParams = {
                        eps: currentProgs,
                        stateful: true,
                        dataCall: dataCallId,
                        orgNameConvention: currentOnc,
                        installation: currentInstallation
                    };
                },   
                store: npDs,
                pageSize: pageSize,
                displayInfo: true,
               //hideRefresh: true,
                displayMsg: 'Organizations {0} - {1} of {2}',
                emptyMsg: "No Organizations available to display"

            })
});
Run Code Online (Sandbox Code Playgroud)

Cin*_*gus 7

Ext.PagingToolbar中没有hideRefresh属性.

您可以通过bbar(Ext.PagingToolbar实例)对象访问刷新按钮.

pPanel.bbar.refresh

您可以使用该hide()功能隐藏它.

pPanel.bbar.refresh.hide()

您还可以在afterrenderExt.PagingToolbar 中的事件中隐藏它:

listeners: {
    afterrender: function() {
        this.refresh.hide();
    }
}
Run Code Online (Sandbox Code Playgroud)

您可以通过覆盖doRefreshbbar中的函数来修改刷新按钮的行为

pPanel.bbar.doRefresh

关于你的代码,beforeLoad除非是故意的,否则覆盖你将修补内部的功能并不是一个好主意.可能会将它移动到商店对象?

请务必查看文档及其代码,因为这有助于您进行调试.;)