PDA

View Full Version : Getting Button by id doesn't have enable/disable method



geewhizbang
11 Aug 2009, 10:06 AM
I have a button:


buttons:
[
{
text: 'New Post',
cls: 'x-form-toolbar-standardButton',
handler: NewPost,
id: 'buttonNewPost',
align: 'right'
}
]


and a bread crumb function that I wrote that refers to it:


KnowledgeBase.Forums.BreadCrumb.add
(
"Write Post", "WritePost", function (bShow)
{
ShowHide(KnowledgeBase.Forums.Forum.Thread.PostEdit.Editor, bShow);
EnableDisable(Ext.get('buttonNewPost'), !bShow);
}, true
);
function ShowHide(o, bshow)
{
if (bshow) o.show(); else o.hide();
}
function EnableDisable(o, bEnable)
{
//fails here: (methods don't exist)
if (bEnable) o.enable(); else o.disable();
}

Condor
11 Aug 2009, 10:08 AM
There is a huge difference between Ext.get and Ext.getCmp.

geewhizbang
11 Aug 2009, 10:43 AM
That's just another of these little newbie things that I've been struggling with. Thanks, it worked.