PDA

View Full Version : how to get html of menuButton



28 Nov 2007, 5:46 AM
Hi,
I have a menuButton.



menuButton = new Ext.Toolbar.Button({id:'show', text: 'show', handler: handler});


How can I get the html that will be generated for menuButton so that I can change add html of menuButton as innerHTML of titlebar of a region.

Thanks.:)

28 Nov 2007, 10:24 AM
inspect your button's dom attribute

are you familiar with firebug?

29 Nov 2007, 3:45 AM
when I create

menuButton = new Ext.Toolbar.Button({id:'show', text: 'show', handler: handler});

I have not added this button to toolbar



var el = menuButton.getEl();
alert("el =" + el);


so I get el as undefined. How can I get html of the button and say print it using alert

Sample code will really help.

Thanks

tryanDLS
29 Nov 2007, 8:30 AM
Print what? The text? Have you looked at the rendered HTML in Firebug - it's a pretty ugly table structure. If you want to inject HTML into a toolbar, there are better ways to do it, than creating a button and then moving that html somewhere else. I would suggest searching - I'm pretty sure there are example of adding things to the toolbar.