Extjs 4禁用分页工具栏的工具提示
我将PagingToolbar作为我的网格的bbar。当工具提示显示时,它会呈现在我的可见屏幕下方,这就是为什么会显示垂直滚动,但当它显示时,垂直滚动会占据视口的某些位置,因此水平滚动也会自动显示,溢出工具提示。基本上我有两个问题Extjs 4禁用分页工具栏的工具提示,extjs,extjs4,extjs-mvc,Extjs,Extjs4,Extjs Mvc,我将PagingToolbar作为我的网格的bbar。当工具提示显示时,它会呈现在我的可见屏幕下方,这就是为什么会显示垂直滚动,但当它显示时,垂直滚动会占据视口的某些位置,因此水平滚动也会自动显示,溢出工具提示。基本上我有两个问题 垂直滚动显示整个视口,但带bbar的栅格仅在南部区域,栅格本身已经具有垂直滚动。是否有某种配置来控制这种行为 如何禁用PagingToolbar的工具提示我有以下不起作用的代码(网格定义,删除) initComponent:function(){ var me=这个;
但是在这段代码中,我得到了这个。bbar是未定义的。为什么?那么bbar是什么时候呈现的?由于ExtJS4,bbar只是将工具栏/项目应用为底部停靠并在init之后取消设置的一种简单方法,请参阅
if (me.bbar) {
docked.push(initToolbar(me.bbar, 'bottom'));
me.bbar = null;
}
我想你可以这样做(我希望这是一个事件,因此评论如下):
afterrender:函数(网格){
//“this”在eventcallback中不应可访问!如果是,则在类定义中,应在callParent()之后使用this.on('beforerender',…)!!
//callParent()应该在类的init中调用,而不是在其他地方!
//这是callParent();
var pagebar=grid.down('pagingtoolbar'),
items=pagebar?pagebar.items.items:[],
len=项目长度,
i=0;
//如果不是真的需要,不要使用每一个!
对于(;i
编辑:
根据上一条注释:您不应该重写网格的afterRender方法,而是将自己注册到afterRender事件中,并在调用父级之后的initComponent()中执行此操作,如代码EXPAPLE的注释中所述
编辑2:
每个按钮上都有一个私有方法,用于清除工具提示。您可能知道,私有方法仍然可以像其他方法一样调用,但在即将发布的框架版本中可以完全更改/删除。其中大多数方法在API中也找不到。您要查找的方法是clearTip()
在要从中删除工具提示的每个按钮实例上调用它。应该可以
我完全监督了你的第一个问题:你应该考虑通过使用<代码> AutoSoCurl:false < /代码>来删除滚动行为,或者使用<代码> VIEWCONFIGG禁用它:{AutoSoCLL:false,Loop:Valu}} /Cult>
< P> >你可以这样做{
dock : 'bottom',
xtype : 'pagingtoolbar',
store : store,
pageSize : 25,
displayInfo : true,
firstText:null,
prevText:null,
nextText:null,
lastText:null,
refreshText:null,
....
尝试在ViewPort中设置
autoscroll:false
我需要将autoscroll设置为true,应用程序有许多路径,有时需要使用autoscroll将autoscroll设置为区域的容器,即面板,而不是ViewPort仍然相同,就好像工具提示不属于容器,而是属于整个页面正文。您可以尝试移动每个在调用initComponent()
方法中的callParent
后的部分。感谢sra,我明白了为什么bbar为null,但为什么我不能在afterRender override中注销工具提示?我使用this测试了我的代码。down('pagingtoolbar')
和console.log(item.getId())
现在返回所有ID。仍然注销吗(btnid)不工作,并且该.callParent();在afterRender override中只调用父级的afterRender函数,不是吗?
afterrender: function(grid) {
// 'this' should not be accessible within a eventcallback! If it is you are within the class definition and should use this.on('beforerender', ...) after the callParent() instead!!
// callParent() should be called within the init of the class, not somewhere else!
// this.callParent();
var pagebar = grid.down('pagingtoolbar'),
items = pagebar ? pagebar.items.items : [],
len = items.length,
i = 0;
// don't use each if it is not really necessary!
for(;i < len; i++) {
var item = items[i];
if (item.getXType() === 'button' && item.tooltip != undefined) {
console.log(item.getId());
Ext.QuickTips.unregister(item.getId());
}
});
}
{
dock : 'bottom',
xtype : 'pagingtoolbar',
store : store,
pageSize : 25,
displayInfo : true,
firstText:null,
prevText:null,
nextText:null,
lastText:null,
refreshText:null,
....