ExtJs Ext.PagingToolbar:隐藏或设置刷新按钮onclick的参数?
刷新按钮没有自定义设置,因此我尝试隐藏/删除它。 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"
})
});
No customized setup for the refresh button, so I am trying to hide/remove it.hideRefresh: true
didn't work for me.
If there is no way to hide it, can I at least pass some parameters when the button is clicked, so I can make it do some meaningful tasks?
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"
})
});
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(6)
Ext.PagingToolbar 中没有 hideRefresh 属性。
您可以通过 bbar(Ext.PagingToolbar 实例)对象访问刷新按钮。
pPanel.bbar.refresh
您可以使用
hide()
函数隐藏它。pPanel.bbar.refresh.hide()
您还可以将其隐藏在 Ext.PagingToolbar 的
afterrender
事件中:您可以通过重写来修改刷新按钮的行为bbar 中的
doRefresh
函数pPanel.bbar.doRefresh
关于您的代码,覆盖
beforeLoad
函数并不是一个好主意除非是故意的,否则你会修改内部结构。也许将其移动到商店对象?请务必查看文档及其代码,因为这将有助于您进行调试。 ;)
There isn't a property for hideRefresh in the Ext.PagingToolbar.
You can access the refresh button via the bbar (the Ext.PagingToolbar instance) object.
pPanel.bbar.refresh
You can hide it using the
hide()
function.pPanel.bbar.refresh.hide()
You can also hide it in your
afterrender
event in your Ext.PagingToolbar:You can modify the behavior of the refresh button by overriding the
doRefresh
function in the bbarpPanel.bbar.doRefresh
Regarding your code, it's not a good idea to overriding the
beforeLoad
function you'll be tinkering with the innards unless its intentional. Maybe moving it to the store object instead?Make sure you check out the documentation and its code as well because that would help you with debugging. ;)
这段代码对我来说工作正常:
This code working fine for me:
在 ExtJs 6.2 中我必须使用以下代码:
In ExtJs 6.2 I had to use this code:
至少在 ExtJS 6.5.2(经典)中,您可以按如下方式重写刷新操作:
In ExtJS 6.5.2 at least (classic), you can override the refresh action as follows:
您可以为分页工具栏提供一些较小的宽度,以便隐藏刷新组件:P
you can give some smaller width to pagination toolbar so that the refresh component gets hidden :P