PDA

View Full Version : How do I disable a MenuButton in ToolBar



niedhui
6 Aug 2007, 1:17 AM
I create a MenuButon
this.chooseBtn=new Ext.Toolbar.MenuButton(
{ text: '@{btn.new}',
handler: thiz.documentList.onNew.createDelegate(thiz.documentList),
menu:{
items:[
{text: '@{btn.upload}', handler: thiz.documentList.onNew.createDelegate(thiz.documentList)},
{text: '@{btn.choose}', handler: thiz.documentList.onOther.createDelegate(thiz.documentList)},
]
}
})
and insert it into a toolbar
this.documentList.getToolbar().insertButton(0,this.chooseBtn);
And when I invoke this.chooseBtn.disable();
It seems not work.And I can handle other Ext.Toolbar.Button by this way.
Any help? thanks!!

niedhui
6 Aug 2007, 1:45 AM
Sorry,I find the way,It should be
this.chooseBtn=this.documentList.getToolbar().insertButton(0,this.chooseBtn);:D