单击EXTJS中的选项卡面板的监听器 [英] click listener for tab panel in EXTJS
本文介绍了单击EXTJS中的选项卡面板的监听器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
这是我现在所做的:
xtype:'tabpanel',
activeTab:0,
region:'center',
items:[
{
xtype: 'panel',
title:'All',
items:[grid]
},
{
xtype:'panel',
标题:'已关闭'
},
{
xtype:'panel',
标题:'打开'
}
],
listeners:{
click:function(){
alert('test');
}
}
}
解决方案
在中没有任何标签点击的事件。 TabPanel
,但是您可以绑定到每个选项卡上的点击事件:
Ext.createWidget('tabpanel ',{
items:[...],
listeners:{
render:function(){
this.items.each(function(i){
i.tab.on('click',function(){
alert(i.title);
});
});
}
}
});
注意:这是基于ExtJS 4的代码。
i use a tab panel in extjs. I want to display an alert when clicked on a tab. But i am not sure how.
This is what i do now:
{
xtype: 'tabpanel',
activeTab: 0,
region: 'center',
items: [
{
xtype: 'panel',
title: 'All',
items: [grid]
},
{
xtype: 'panel',
title: 'Closed'
},
{
xtype: 'panel',
title: 'Open'
}
],
listeners: {
click: function () {
alert('test');
}
}
}
How can is display All, Closed or Open when there is clicked on that tab?
解决方案
There is no event for tab click in TabPanel
, however you can bind into click event on each tab:
Ext.createWidget('tabpanel', {
items: [...],
listeners: {
render: function() {
this.items.each(function(i){
i.tab.on('click', function(){
alert(i.title);
});
});
}
}
});
Notice: this is ExtJS 4 based code.
这篇关于单击EXTJS中的选项卡面板的监听器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文