PDA

View Full Version : Menu Not Displaying



vajrakumar.d
21 Apr 2011, 12:43 AM
Hi ,

I am using a tab panel in which my last tab is more tab.
On clicking of that tab in before tab change function i have written :
tabPanel.moreMenu.showAt([300,300]);
return false;

i am returning false as i don't want to activate that more tab.
I just want to display the menu .

This ]menu coming after 3-4 clicks, but not on single click.
I thought it may be taking time to build , but its not the case. After clicking 3-4 times it is coming some times it comes at 2 click & even single click some times.

Dont know why.

Please help me to fix this issue.

Screamy
21 Apr 2011, 4:56 AM
Can you provide a testable code sample?

vajrakumar.d
21 Apr 2011, 5:44 AM
'beforetabchange':function(tabPanel,newTab,currTab,e){
var positionXY = newTab.tabEl.getClientRects()[0];
if(newTab.domainID == -3) {
tabPanel.moreMenu.showAt([positionXY.right,positionXY.bottom]);
return false
};

}
//-----------------------------------------------

this.moreMenu = new Ext.menu.Menu({items:menuArray,
showSeparator:false,
cls:'x-menu-no-icon',
searchID:this.searchID,text:text,
solrFields: this.solrFields,
gblSID: this.gblSID,

lProcessID: this.lProcessID,
permXml: this.permXml,
listeners: {
'click': function(menu,item) {
var ciTabPanel = Ext.getCmp('ci-tab-panel');
var tabTitle = item.title +" ("+ item.count+")";
if(item.title.length >12)
tabTitle = item.title.substring(0,10) +"... ("+ item.count+")";

ciTabPanel.insert(ciTabPanel.items.length-1,{title:tabTitle,
xtype: 'citabpage',
text:item.title,
count:item.count,
searchID:menu.searchID,
solrFields: menu.solrFields,
gblSID: menu.gblSID,
lProcessID: menu.lProcessID,
permXml: menu.permXml,
domainID:item.domainID,
parentContainer:item.parentContainer,
closable:true});

ciTabPanel.setActiveTab(ciTabPanel.items.items.length -2);


if(menu.items.items.length ==1)
item.parentContainer.remove(Ext.getCmp('see-more'));
menu.remove(item);
}}
});


This is my code where I am displaying the menu.
Ha, I have written that before tabchage in tab panels listeners