PDA

View Full Version : How to show/hide ytb-text, and ytb-sep element?



franklt69
2 Jan 2007, 11:13 AM
Hi I need some hint about how to do it, I don't found in the newsgroup info about it.

kind regards
Frank

tryanDLS
2 Jan 2007, 11:48 AM
Please don't repost the same questions multiple times.

As I have said previously, you need to get a reference to the HTML element. Look at the toolbar and button classes to see how they do things like hide/show. Adding a button to a toolbar returns a ref to the button. You can then call hide/show.

franklt69
2 Jan 2007, 3:56 PM
Ok sorry Tim.

I can show/hide the buttons in the toolbar but I don't know how to do it with 'ytb-sep or ytb-text because the same code don't work with its.

it work:

feedtb.addSeparator(); //this don't have id how found it and show/hide?
feedtb.add('Page') //the same

feedtb.addButton({id:'btnFind', text: 'Find', className: 'navFind', tooltip: 'Find', click: this.showAddFeed.createDelegate(this)});

getEl("btnFind").hide();
getEl("btnFind").show();


In the other thread you say: have to retrieve them by classname(ytb-sep) and change the visibility could you give a little example?

kind regards

Frank

tryanDLS
2 Jan 2007, 4:24 PM
toolbar.getEl().getChildrenByClassName('ytb-sep') will return an array of the separators, but since they don't have IDs, you're going to have to work out a way to determine which ones to hide.

If you can't work this out in the short term, you could just disable buttons, rather than hiding them.

franklt69
3 Jan 2007, 5:45 AM
Ok thanks Tim now work ok I did it:

var x;
var tbSep = new Array()
tbSep = feedtb.getEl().getChildrenByClassName('ytb-sep');
for (x in tbSep)
{
tbSep[x].hide();
}

kind regards
Frank